Menu

Reading a Java Version String Without Guessing: 1.8.0_NNN, 21.0.x and Vendor Build Numbers
📰

Reading a Java Version String Without Guessing: 1.8.0_NNN, 21.0.x and Vendor Build Numbers

DEV Community: java·TechGuide HQ·about 16 hours ago
#19yw0A7u
#devtojava#devto#dev#java#version
Long article (569 words) — no AI summary yet.
Reading 0:00
15s threshold

Every time a big Java security advisory lands, the same question turns up in team chats and family group chats: "I ran java -version , it printed something. Am I affected?" The command is the easy part. Reading the output is where people slip, because Java has used two numbering styles and every vendor adds its own build numbers on the end.

This is a short decoding guide. It doesn't replace the vendor advisories; it helps you read them.

Step 1: Find the major version

Run java -version in Terminal and look only at the first line.

java version "1.8.0_NNN" is Java 8. The "1." prefix is the old naming style, so 1.8 means 8, and NNN is the update number.

openjdk version "11.0.x" is Java 11.

"17.0.x" , "21.0.x" , "25.0.x" , "27.0.x" : from Java 9 onward the first number is the major version.

The most common mistake is reading "1.8" as "Java 1" and assuming it's ancient and irrelevant.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.