What version of javac built my jar?

前端 未结 20 897
孤街浪徒
孤街浪徒 2020-11-27 09:48

How can I tell what version of the Java compiler was used to build a jar? I have a jar file, and it could have been built in any one of three JDKs. We need to know exactly

20条回答
  •  清酒与你
    2020-11-27 10:45

    There is no need to unpack the JAR (if one of the class names is known or is looked up e.g. using 7zip), so on Windows the following would be sufficient:

    javap -cp log4j-core-2.5.jar -verbose org.apache.logging.log4j.core.Logger | findstr major
    

提交回复
热议问题