Java – Understanding JDK, JRE, and Version Confusion

gcjjava

(Note: this questions and its answers are from 2011 and show how the world was at that time.)


Although I'm not a real Java developer (yet), I feel like I should know this by now, but I'm still very confused. My question has two parts:

  1. What is the difference between the so-called (as I've seen it) "Sun JDK", OpenJDK, and GCJ?

  2. At various times, I've seen each of the following thrown around, making it very confusing to understand which version numbers actually apply to what. Can someone please help me sort this out?

    • Java 6
    • Java 1.6
    • JDK 6
    • JDK 1.6
    • JRE 1.6
    • JVM 11.0

Note: I do understand the difference between the JDK (Java Development Kit) and the Java Runtime Environment. I'm not totally clear on the difference between the JRE and JVM however, although I know what the JVM is/does.

Best Answer

Note: As of 2023 the Java world has changed somewhat. OpenJDK is now the open source code base underlying several distributions using the HotSpot JVM, including the now commercial Oracle Java. IBM has an alternative using their J9 JVM. Unless you have good reason to, any OpenJDK distribution is fine.

Java 6 and Java 1.6 are the same. Originally Java was named Java 1.X but as time went, Sun marketing found that it would better signal the significant improvements done if they dropped the "1." part. The first version to do so was Java 1.5 which was marketed as Java 5.

JRE 6 is the consumer distribution of Java 6. It is easy to download from http://java.com.

JDK 6 is the developer distribution of Java 6. It contains tools like a compiler and support for more cultures than the default JRE. It needs to be downloaded from http://javasoft.com.

JVM 11.0 is the version of the Java "interpreter" inside the Oracle JRE/JDK (other vendors use different numbers). This is similar to saying that Windows Vista is really Windows 6.0.6001.

Related Question