Pages Navigation Menu

Coding is much easier than you think

How to find the JDK target version from a .class file?

How to find the JDK target version from a .class file?

 
This tutorial gives a tip to find out the JDK compiler target version from a .class file
 

javap -verbose YourJavaClass

 

On running the above command in command prompt, it displays the major version number, based on which the JDK Compiler version can be determined.
 
Below are some example values:
 

JDK 1.0 -> major version 45
JDK 1.1 -> major version 45
JDK 1.2 -> major version 46
JDK 1.3 -> major version 47
JDK 1.4 -> major version 48
JDK 5   -> major version 49
JDK 6   -> major version 50
JDK 7   -> major version 51

 

About Mohaideen Jamil


Am currently working as a Struts 2 Developer in a reputed IT Organisations. I can help you with teaching Core java and Struts 2. Follow me on Facebook or Google Plus. If you like my tutorials, consider making a donation to this charity, thanks.