Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何判断 java 类是否已编译用于 java 6 vm?
有没有简单的方法?
它在类文件格式规范中。有关该主题的WP 文章包括当前的版本号常量集。
在 unix 中,
$ javap -classpath <classpath> -verbose foo.Bar \ | grep -q 'major version: 50' && echo yep || echo nope
谢谢@matt b。
通过使用java 反编译器