'Why do I see open JDK 1.8 instead of Java 8?
When I check my Java version like this:
java -version
I see openjdk version 1.8.0 runtime environment build ...
, but I thought I had Java 8 installed.
Why does the version number show up as 1.8?
Solution 1:[1]
From Java Platform, Standard Edition 8 Names and Versions:
In JDK 8 and JRE 8, the version strings are 1.8 and 1.8.0
Why? Because the developers of Java chose to name the versions like this. I can only assume the real reasons, but I think it is, because naming it Java 8 implies that it is new and much better than Java 7 but keeping the version bump from 1.7 to 1.8 indicates that it is still version 1.x and therefore still backwards compatible. In the end it is marketing.
Solution 2:[2]
Before Java 9, Java version X
was internally specified as 1.X
according to these specs.
Then came JEP 223 which proposed to change the version to just X
starting with Java 9.
It should be noted that different tools may even use other conventions. For instance in Gradle there is JavaVersion.VERSION_1_9
, JavaVersion.VERSION_1_10
and they only switch to the new convention in JavaVersion.VERSION_11
(see their code comment).
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | |
Solution 2 | bluenote10 |