aspose file tools*
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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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

Abhijeet Pathak
Ranch Hand

Joined: Jul 05, 2009
Posts: 33
Can anyone tell me the exact difference between JRE and JVM?
If Java is platform independent language,then why do we need a JRE for running JAVA programs?


I am the one who knows that I don't know anything.
Abhijeet
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24166
    
  30

Java code is compiled to the machine language of an idealized computer called the Java Virtual Machine (JVM). To run Java code on a real computer, you need a program that implements the imaginary computer. The program "java.exe" is such a program.

The Java Runtime Environment (JRE) is a JVM, plus the various libraries of class files and their native code that are needed to support the full Java API. The file java.exe by itself is not actually enough to run a Java program -- you need a full JRE.

Regarding platform independence: Java bytecode will run on any JRE. You can implement the JRE on virtually any real computer, and this makes Java code binary compatible across all those platforms.



[Jess in Action][AskingGoodQuestions]
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36478
    
  16
And welcome to JavaRanch
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 13872
    
  10

You can compare it to a car: The JVM (Java Virtual Machine) is the motor. But if you want to go anywhere, you need more than just a motor. The JRE (Java Runtime Environment) is the complete car, including the motor. So to run Java programs, you need a JRE, and not only a JVM.

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Difference between JRE and JVM
 
Similar Threads
Re:JRE and JVM
difference between JRE & JVM
JRE,JVM & Plugins
Difference between JDK, JRE and JVM
jre & jvm