• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JVM Vs JRE

 
Tom Lee
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
Could anyone explain me the difference between JVM and JRE ?

Thanx in advance,
Tom
 
Steve Morrow
Ranch Hand
Posts: 657
Clojure Spring VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The JVM is the virtual machine in which your programs run. The JRE is the runtime environment that includes the JVM and supporting files.

http://faq.javaranch.com/view?SearchFirst
 
Pankaj Shirke
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Difference between JRE and a JVM.
JVM is needed when you compile your source code.It is a part of Java SDK whereas JRE contains libraries which are required by your programs at runtime.
Once you compile a java code,form a class file and you port it to a different machine you only require JRE on that machine to run your program and no JVM/Java SDK.
 
Steve Morrow
Ranch Hand
Posts: 657
Clojure Spring VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JVM is needed when you compile your source code.It is a part of Java SDK whereas JRE contains libraries which are required by your programs at runtime.
Once you compile a java code,form a class file and you port it to a different machine you only require JRE on that machine to run your program and no JVM/Java SDK.
That's not correct; all JREs include a JVM. Furthermore, a JVM is not necessary to compile Java source code; only run it.

For more information on the JVM, check out the following: The Java� Virtual Machine Specification
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15441
41
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
An analogy:

JVM = only the engine
JRE = a complete car including the engine

If you want to drive, you need more than only the engine. You need a car, which includes the engine.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Furthermore, a JVM is not necessary to compile Java source code; only run it.

Of course, if you use the "javac" compiler, you do need a JVM, because javac is implemented in Java, so it needs a JVM to run. (As a counter-example, IBMs jikes compiler is written in C, so it needs no JVM to run.)

Besides some tools and supporting files, the biggest part of the JRE that is not part of the JVM are the class libraries.
[ September 29, 2005: Message edited by: Ulf Dittmer ]
 
Steve Morrow
Ranch Hand
Posts: 657
Clojure Spring VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[QUOTEAn analogy:

JVM = only the engine
JRE = a complete car including the engine
Good analogy. So good, in fact, that I'm going to start referring to my vehicle as a DRE (Dodge Runtime Environment)...
 
Naveen Vooka
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java Runtime Environment - The JRE consists of the Java virtual machine, the Java platform core classes, and supporting files. It is the runtime part of the Java Development Kit -- no compiler, no debugger, no tools. The JRE is the smallest set of executables and files that constitute the standard Java platform.

Java Virtual Machine. An abstract computing machine, or virtual machine, JVM is a platform-independent programming language that converts Java bytecode into machine language and executes it. Most programming languages compile source code directly into machine code that is designed to run on a specific microprocessor architecture or operating system, such as Windows or UNIX. A JVM -- a machine within a machine -- mimics a real Java processor, enabling Java bytecode to be executed as actions or operating system calls on any processor regardless of the operating system. For example, establishing a socket connection from a workstation to a remote machine

--------------
Naveen Vooka
www.devsquare.com
DevSquare - Online Application Development
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic