File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes difference between JVM and JRE Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "difference between JVM and JRE" Watch "difference between JVM and JRE" New topic

difference between JVM and JRE

sunil kumre
Ranch Hand

Joined: Dec 23, 2000
Posts: 64
can someone explain what is the exact difference between JVM and JRE?
thanks in advance
Margaret Tan

Joined: Sep 14, 2001
Posts: 20
JVM is the INTERPRETER that interprets java bytecode to the machine code or binary file for the hardware to understand it while the JRE is the JVM together with the API's (the pre-written java class code in order for a user to be able to RUN the java program. Although there is another one called the Java 2 (this is the java technology that you download from the web which is also called JDK 1.3) wherein it contains JRE and all other stuff that will allow you to WRITE program which includes API's, tools and documentations.... anyway, I'm also confused about JRE and Java 2.... is my explanation clear though??? anyone there would like to clarify it a bit?
Danish Shaukat
Ranch Hand

Joined: Nov 16, 1999
Posts: 340
What is the Java Virtual Machine?
The JVM is the software that executes Java bytecode. A Java program, written in a file with a .java extension, is compiled into class files that have a .class extension. The class files are written in bytecode. To execute these files, the computer uses the JVM to interpret the bytecode.
A browser that is capable of executing Java applets has the JVM built into it. To run a Java application, the Java Runtime Environment (JRE) must be installed. The JRE contains the files in the Java Development Kit minus the development tools, only the files necessary to run a Java application are present.
The bytecode is the same for all platforms, but the JVM will be different on different platforms because it needs to execute programs using the native code of the machine it is running on

Roseanne Zhang
Ranch Hand

Joined: Nov 14, 2000
Posts: 1953
The JRE package is intended for distribution with applications. It does not contain the tools.jar file that has the compiler and other command line tools. The reason Sun makes the distinction is to give developers a more compact set of files to distribute with a product.
Also, JVM is the more generic name which can apply to any program which obeys the Java Virtual Machine Specification - whether it's made by Sun, IBM, Microsoft, or whoever. JRE on the other hand is the name for Sun's implementation of a JVM.

JavaChina has been moved to
Roseanne Zhang
Ranch Hand

Joined: Nov 14, 2000
Posts: 1953
Java Interpreter is absolutely a vital part of JRE.
I agree. Here's the link:
subject: difference between JVM and JRE
It's not a secret anymore!