• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JVM, JRE and Compiler

 
jignesh soni
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 48652
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Somebody asked a very similar question recently: here. See whether that answers your question
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15216
36
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic