Java virtual machine: Difference between revisions

Content deleted Content added
rv -- JRE redirects to Java programming language, which is already linked
m Cleanup. Move some sentences to Class (file format) and Jar (file format)
Line 1:
The '''Java virtual machine''' or '''JVM''' is a [[virtual machine]] that runs Java [[byte code]],. theThis code producedis bymost aoften generated by [[Java programming language|Java]] [[compiler]]s, oralthough compilersthe fromJVM otherhas languagesalso whichbeen producetargeted thisby codecompilers of other languages.
 
The (JVM) is a crucial component of the [[Java platform]]. The availability of JVMs on almost all types of hardware and software [[platform (computing)|platforms]] enables Java to function both as [[middleware]] and a platform in its own right. Hence the expression "[[Write once, run anywhere]]."
Programs written in Java are compiled into a standardized portable binary format, which typically comes in the form of files with the [[class (file format)|.class]] extension. A program may consist of many classes, in which case, every class will be in a different file. The first 4 bytes in hexadecimal of each class must be CA FE BA BE. Class files may be packaged together in a [[jar (file format)|.jar]] file, with the exact same format as a [[zip (file format)|.zip]] file, optionally with a few extra special files added.
 
Programs writtenintended into Javarun areon a JVM must be compiled into a standardized portable binary format, which typically comes in the form of files with the [[classClass (file format)|.class]] extensionfiles. A program may consist of many classes, in which case, every class will be in a different file. TheFor firsteasier 4distribution bytesof inlarge hexadecimalprograms, of eachmultiple class must be CA FE BA BE. Class files may be packaged together in a [[jar (file format)|.jar]] file, with the exact same format as a [[zip (file format)|.zip]] file, optionally with a few extra special files added.
 
This binary is then executed by the JVM [[runtime]] which carries out [[emulation]] of the JVM [[instruction set]] by [[Interpreter (computing)|interpreting]] it or by applying a [[just-in-time]] Compiler (JIT).
 
The JVM has a [[Stack (computing)|stack]] based architecture.
 
Each [[Thread (computer programming)|thread]] has its own program counter.