开发者

Is there a way to tell if a class was compiled for java6?

开发者 https://www.devze.com 2023-01-02 09:36 出处:网络
How can I do to tell if a java class was compiled for use on a java 6 vm? I开发者_如何学Gos there an easy way? It\'s in the class file format specification. The WP article on the subject includes the

How can I do to tell if a java class was compiled for use on a java 6 vm?

I开发者_如何学Gos there an easy way?


It's in the class file format specification. The WP article on the subject includes the current set of version number constants.


In unix,

$ javap -classpath <classpath> -verbose foo.Bar \
  | grep -q 'major version: 50' && echo yep || echo nope

thanks @matt b.


By using a java decompiler

0

精彩评论

暂无评论...
验证码 换一张
取 消