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 JVM, JRE and Compiler 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 "JVM, JRE and Compiler" Watch "JVM, JRE and Compiler" New topic

JVM, JRE and Compiler

jignesh soni
Ranch Hand

Joined: Dec 10, 2007
Posts: 150
1 Is JVM and JRE one and same or different ?

2 When we install JDK, does JRE get installed with it or is it separate install ?

3 Compiler gets installed with JDK or JRE ?

4 If JVM is separate from JRE, does it get installed with JDK ?
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 36468
Somebody asked a very similar question recently: here. See whether that answers your question
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 13868

Look at it this way:

The JVM (Java Virtual Machine) is the engine of Java - it's the thing that executes your Java bytecode.

The JRE (Java Runtime Environment) is a complete car, including the engine (JVM). To be able to go somewhere, you need more than just the engine - you need a car with an engine in it. The JRE is the car around the JVM: the standard Java library and other things you need to run Java programs.

When you install the JDK, a JRE is also installed - it wouldn't make much sense to have just a Java compiler without any way to run Java programs, and besides that, the Java compiler itself is written in Java so it needs a JRE to run.

The compiler ofcourse comes with the Java Development Kit (not with the JRE).

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
It is sorta covered in the JavaRanch Style Guide.
subject: JVM, JRE and Compiler
Similar Threads
JAVA2 1.2 compiler
Confusion in JRE, JVM and JDK
Java 2 SE SDK for OS X
Collection specific elements not generic problem