开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜