How to find out the Java version of a compiled class file

It has been confirmed up to Java10 (as of 2018/08/01).

command

javap -v file.class | grep "major version" | awk '{ print $3 - 44 }'

Commentary

The major version value displayed by the javap -v command seems to be the" supported class version "(≠ Java version). The class version is "Java version +44", so you can subtract it.

Java maintains compatibility = supports all previous "supported class versions" It seems like that.

Concern

It is unclear what will happen after Java 9 because the versioning method will change. Will there be a beta version of the future version someday?

2018/03/12 postscript

It seems that the version notation after Java 10 is as ↓. I don't know how it actually comes out with java -version, but for reference.

https://qiita.com/nowokay/items/d9bc4b3f715d17c2830d#322-time-based-release-versioning

reference

Recommended Posts

How to find out the Java version of a compiled class file
[Java] How to use the File class
I want to find out which version of java the jar file I have is available
[Java] How to get to the front of a specific string using the String class
[Processing × Java] How to use the class
How to install the legacy version [Java]
[Java] How to use the Calendar class
[chown] How to change the owner of a file or directory
How to check for the contents of a java fixed-length string
How to get the length of an audio file in java
How to find the cause of the Ruby error
The story of forgetting to close a file in Java and failing
How to convert a solidity contract to a Java contract class
[Java] How to use substring to cut out a part of a character string
How to find the total number of pages when paging in Java
How to get the absolute path of a directory running in Java
[Java] How to get the authority of the folder
[Java] How to get the URL of the transition source
[Java] How to use compareTo method of Date class
How to jump from Eclipse Java to a SQL file
How to write Scala from the perspective of Java
[Java] Check the JDK version of the built war file
[Java] How to extract the file name from the path
[Ruby] How to find the sum of each digit
[Java] How to get the maximum value of HashMap
[Java] How to cut out a character string character by character
How to convert a file to a byte array in Java
How to download the old version of Apache Tomcat
How to lower java version
How to use java class
How to find the total value, average value, etc. of a two-dimensional array (multidimensional array)-java
A memo about the types of Java O/R mappers and how to select them
How to save a file with the specified extension under the directory specified in Java to the list
How to get the class name / method name running in Java
An unsupported Java version How to get rid of errors
Find out all timezone IDs supported by the Java TimeZone class
How to move another class with a button action of another class.
[Java] How to use substring to cut out a character string
[Ruby] How to retrieve the contents of a double hash
How to mock some methods of the class under test
How to derive the last day of the month in Java
How to change the contents of the jar file without decompressing
[jsoup] How to get the full amount of a document
I want to find the MD5 checksum of a file in Java and get the result as a string in hexadecimal notation.
[Java version] The story of serialization
How to make a Java container
How to disassemble Java class files
How to use the wrapper class
Considering the adoption of Java language in the Reiwa era ~ How to choose a safe SDK
[Java] How to create a folder
How to decompile java class files
[Java] How to use LinkedHashMap class
How to use class methods [Java]
How to make a Java array
[Java] How to use Math class
How to find Java prime numbers
How to create a jar file or war file using the jar command
Get the public URL of a private Flickr file in Java
Read the first 4 bytes of the Java class file and output CAFEBABE
I made a tool to output the difference of CSV file
How to increment the value of Map in one line in Java