Meaningless Drivel is fun!*
The moose likes Beginning Java and the fly likes Difference between JRE and JVM Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Difference between JRE and JVM" Watch "Difference between JRE and JVM" New topic
Author

Difference between JRE and JVM

kiran mahavir
Ranch Hand

Joined: Jan 09, 2001
Posts: 35
Hello Javaranch,
Please let me know the difference between JVM and JRE ans what are their roles.
Thanking in advance
Kiran
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
The JVM (Java Virtual Machine) is actually a set of specifications that Sun puts out for makers of browsers and embedded chips etc. to follow when creating their JVMs for their products. When you run an applet or servlet it is running in a JVM.
The JRE (Java Runtime Environment) is the equivalent of a JVM but for running applications outside of a browser (like from the DOS prompt). It contains the Java Foundation Classes for the release of Java that it implements.
A JIT (Just In Time Compiler) is a tool to increase the performance of Java Applications. If the "interpreting" of the code is slowing things down, then you can use a JIT to actually compile the JAVA code on the fly to a machine
specific version, which speeds things up.
Check out http://www.javaranch.com/ubb/Forum1/HTML/000791.html

"JavaRanch, where the deer and the Certified play" - David O'Meara
kiran mahavir
Ranch Hand

Joined: Jan 09, 2001
Posts: 35
Thanx for the reply cindy. Can you u let me know then what is a java plugin and why it is used for?
thanx in advance
kiran
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
Well, when SUN released Java 2, the browser vendors like Netscape and Microsoft needed time to get the new stuff incorporated into their JVMs (that still hasn't happened). So Sun provided the plug-ins as a method for programmers to be able to use the newest stuff right away. You download the file, and it re-directs the browsers to use that version of java instead.
The plug-ins are available from Sun at:
http://java.sun.com/products/plugin/index.html
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Difference between JRE and JVM