I have a java jar file. How can I check with which version of java , the jar file got created which build was performed. There was a recent Java upgrade happened on my system from Java Version 1.6 to Java version 1.8 and a Jar file stopped working.
Asked
Active
Viewed 2,111 times
1 Answers
3
On Linux, Mac OS X or Windows with Cygwin installed, the file(1) command knows the class version.
$ file ./org/apache/log4j/Appender.class
./org/apache/log4j/Appender.class: compiled Java class data, version 45.3
And if you are relegated to a Windows environment without either file or grep
> javap -v ./org/apache/log4j/Appender.class | findstr major
major version: 45
Reference: What version of javac built my jar?

Vishwa Ratna
- 5,567
- 5
- 33
- 55