Monthly Archives: January 2019

Extract the Java version of a .class file

Every Java Class file has been compiled with a specific Java version. To get the version try:

/path/to/jdk/bin/javap -verbose ClassFile | grep "version:"

Here is the list of all currently known Java versions:


    Java 1.2 uses major version 46
    Java 1.3 uses major version 47
    Java 1.4 uses major version 48
    Java 5 uses major version 49
    Java 6 uses major version 50
    Java 7 uses major version 51
    Java 8 uses major version 52
    Java 9 uses major version 53
    Java 10 uses major version 54
    Java 11 uses major version 55