How can I find the target Java version for a compiled class?

前端 未结 5 1541
萌比男神i
萌比男神i 2020-12-01 08:22

Duplicate:

Tool to read and display Java .class versions

If I have a compiled Java class, is there a way to tell from just the cla

5条回答
  •  无人及你
    2020-12-01 09:08

    Linux/Unix users have a nice tool out of the standard toolbox: file utility. Modern versions can detect the Java class fersion version and even output Java version for known class file types.

    Example output:

    com/sample/Tracker.class: compiled Java class data, version 45.3
    com/sample/TestListener.class: compiled Java class data, version 49.0 (Java 1.5)
    

    And it fits very nicely into the standard Unix scripting toolchain.

提交回复
热议问题