How can I do to tell if a java class was compiled for use on a java 6 vm?
Is there an easy way?
How can I do to tell if a java class was compiled for use on a java 6 vm?
Is 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.