Java API to find out the JDK version a class file is compiled for?

前端 未结 8 1024
星月不相逢
星月不相逢 2020-11-28 07:52

Are there any Java APIs to find out the JDK version a class file is compiled for? Of course there is the javap tool to find out the major version as mentioned in here. Howev

8条回答
  •  孤街浪徒
    2020-11-28 08:17

    JavaP does have an API, but it's specific to the Sun JDK.

    It's found in tools.jar, under sun/tools/javap/Main.class.

提交回复
热议问题