-4

I just read JRE is an implementation of JVM and HotSpot VM is also an implementation of JVM. Which one

is correct ?

Aman
  • 979
  • 3
  • 10
  • 23
  • Duplicate of [this question](http://stackoverflow.com/questions/11547458/what-is-the-difference-between-jvm-jdk-jre-openjdk) and [this one](http://stackoverflow.com/questions/16568253/difference-between-jvm-and-hotspot)? – Cyäegha Sep 07 '14 at 21:01
  • @Cyaegha but it says nothing about JRE – Aman Sep 07 '14 at 21:04
  • Sir but they do not link the two, which is what I am asking. – Aman Sep 07 '14 at 21:14
  • 1
    Short answer: the JRE includes a JVM amongst other things (standard libraries, various tools and utilities). In case of Oracle's JRE (or OpenJDK's JRE), the included JVM is Hotspot. – Cyäegha Sep 07 '14 at 21:21
  • thanks a lot sir your short answer removed all my doubts – Aman Sep 07 '14 at 21:24

2 Answers2

0

Both

The JLS, "Java language specification", defines the grammar and features of the Java language (http://docs.oracle.com/javase/specs/). When you create a piece of Java code, it must be compiled before it can be run, which means turned into a low-down set of instructions that your machine understands.

A compiler can, hypothetically, turn this into machine instructions on any architecture. Java was designed to be "portable," i.e., operate accross many systems. The JVM, Java Virtual Machine, itself compiled onto many architectures, was an answer to this. Instead of compiling for macos, linux, and windows, you compile into Java Byte Code, and the JVM, (again, itself compiled onto those OS), interprets your code.

You can read more about the hotspot here http://www.oracle.com/technetwork/java/javase/tech/index-jsp-136373.html

en_Knight
  • 5,301
  • 2
  • 26
  • 46
0

Java Virtual Machine is a specification that allows vendors implement different versions.

Wikipedia has a list of different JVMs.

Oracle Java SE HotSpot is one JVM implementation out of many that is able to compile java code to native code "just-in-time".

JRE is simply a JVM implementation plus an implementation of the standard Java API and libraries and some other stuff.

Petter Nordlander
  • 22,053
  • 5
  • 50
  • 84