NOTE: This article is 3 years or older so its information may no longer be relevant. Read on at your own discretion! Comments for this article have automatically been locked, refer to the FAQ
for more details.
It's easy to check the JDK version that a .class file has been compiled with using the javap tool. Simply run something like this...
That will produce output like this...
Even though I primarily code in Java, I never remember the class version names and their equivalent JDK versions. So instead of looking it up I added this handy function to my Bash ~/.profile file to tell me the JDK version for a .class file...
Using it is simple, simply do this:
The output is a little bit more friendly than what javap produces, for example:
A quick disclaimer...
Although I put in a great effort into researching all the topics I cover, mistakes can happen.
If you spot something out of place, please do let me know.
All content and opinions expressed on this Blog are my own and do not represent the opinions of my employer (Oracle).
Use of any information contained in this blog post/article is subject to this disclaimer
Other posts you may like...