简体   繁体   中英

How do I determine the JDK version based on the javac -version output?

Most people (and the Oracle website) seem to refer to the JDK version as a single digit, like "Java SE Development Kit 7."

However, the output of javac -version is of the format: javac 1.6.0_24

I suspect, but would like some verification that the second digit, 6 in this case, refers to the JDK version. Is this correct, or is there another way to determine the single-digit JDK version?

The second digit is almost the correct answer.

For 1.7, "Java 7"
For 1.6, "Java 6"
For 1.5, "Java 5"
For 1.2 through 1.4, "Java 2" or alternatively (if being more specific) "Java (second digit)"

Java 1.1 and 1.0 was simply marketed as "Java". Not enough people were using 1.0 to trigger a re-branding in the more capable 1.1.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM