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

前端 未结 5 1538
萌比男神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:10

    You can use the javap utility that comes with the standard JDK.

    javap -verbose MyClass
    
    Compiled from “MyClass.java”
    public class MyClass extends java.lang.Object
    SourceFile: “MyClass.java”
    minor version: 3
    major version: 45
    

提交回复
热议问题