How do Java applets get loaded?

4

1

I had this conversation yesterday with a friend of mine and I was trying to explain to him that applets are precompiled code that is loaded by the JVM through the Java browser plugin. I am trying to find some documentation or a detailed description of what is going on in the browser when a site with an applet is visited and eventually how it gets loaded, but couldn't.

Could anyone please provide some insight?

catwoe

Posted 2011-10-07T16:18:40.020

Reputation: 41

Answers

7

Quick answer: Java source code in .java files is compiled to .class files that contain Java byte code. These are packaged into a single .jar file. The web page HTML includes a reference to this jar file. The browser fetches the jar, fires up the locally installed Java Virtual Machine (JVM) and hands it the jar file data. The JVM then does Just-In-Time (JIT) compilation of byte-code to native code as necessary.

Oracle have provided some information on Applet launching.

RedGrittyBrick

Posted 2011-10-07T16:18:40.020

Reputation: 70 632