Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JDK, JRE, Java: Version Confusion!

Tags:

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.

like image 550
Brian Lacy Avatar asked Jan 14 '11 22:01

Brian Lacy


People also ask

Does JDK and JRE need to be same version?

Coming to your Question; No it is not necessary to have both JDK and JRE of same version as we don't use both at the same time.

Can JDK and JRE be different versions?

The JDK and JRE versions can be different on the same computer. Multiple JDK and JRE versions are allowed on the same computer; it is better to find out which version is configured in the system classpath to run or compile the Java program.

Is JDK version same as Java version?

The Java Development Kit (JDK) is part of the Java SE Product, there are other parts as well, but you can treat them as the same thing for development purposes.

Is Java 1.8 the same as Java 8?

javac -source 1.8 (is an alias for javac -source 8 ) java.


1 Answers

  1. Sun JDK is made by Sun, OpenJDK is a competing open source implementation. GCJ is the GNU java compiler.
  2. Java 6 = Java 1.6 and JDK 6 = JDK 1.6

Details item 1 http://en.wikipedia.org/wiki/OpenJDK https://stackoverflow.com/questions/1977238/why-should-i-use-the-sun-jdk-over-the-openjdk-or-vice-versa

http://en.wikipedia.org/wiki/GNU_Compiler_for_Java

How does the GCJ relate to the Sun JDK/OpenJDK? There is no direct relation that I am aware of. GCJ is a separate project. What are the merits of using one JDK over the other? Licensing issues can occur if you redistribute the Sun JDK. Personally I put more trust in the Sun JDK, because of its stability. Isn't OpenJDK a Sun project? Yes and no. It's a community project.

like image 62
Navi Avatar answered Sep 22 '22 15:09

Navi