Saturday, July 4, 2015

How to get java version used to compile a Class file

I been working with an old java legacy code. The problem is that I have access to the SVN Repository, but we're not sure if the code is in sync with production. So I grab the ear file that is in production and wanted to know which java version was used to compile.

The solution was easy using javap command, which is an disassemble tool for java.

 $ javap -verbose ConsultasVariasEJB.class | grep "major"

We found major version: 49, which means JDK 1.5. I you want to see the complete list please see my post Java Class Versions.

References:

No comments:

Post a Comment