• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JVM and JRE

 
Pawanpreet Singh
Ranch Hand
Posts: 264
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

What is the difference in JVM and JRE.
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24211
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The JVM (Java Virtual Machine) is essentially just the program java.exe, without the Java runtime libraries. You can't really do anything with the JVM by itself; you need a JRE, a Java Runtime Environment, which includes all the classes in the standard Java API.
 
Bill Shirley
Ranch Hand
Posts: 457
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
good diagram:
http://java.sun.com/j2se/1.5.0/docs/
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15356
39
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The JVM (Java Virtual Machine) is just the motor. But if you want to travel somewhere, you need more than just the motor - you'll need a complete car. The JRE (Java Runtime Environment) is the car - it's the motor, with everything around it that you need to be able to use it.
 
An Sush
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JVM is required for running Java programs and applications (like applets).
JRE is a level higher than JVM and it supports developement of Java code. You can run Java program(.class file) in JVM but cant compile (.java file). using JRE you can compile java (.java) and run(.class) it as well
 
Campbell Ritchie
Sheriff
Pie
Posts: 49382
62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by An Sush:
JVM is required for running Java programs and applications (like applets).
JRE is a level higher than JVM and it supports developement of Java code. You can run Java program(.class file) in JVM but cant compile (.java file). using JRE you can compile java (.java) and run(.class) it as well


I am afraid you are mistaken.

The JRE contains a JVM, so does the JDK. Both will run Java bytecode files.

The JDK contains compiling tools, libraray classes (the API) etc., as well, so you can create new bytecode files with the JDK.
 
ragha naidu
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JRE = JVM + some standard JAVA class libraries [which are used to implement API]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic