Reputation: 8905
On my development machine, I have JDK 1.7 installed, but we are packaging software for use with Java 1.5 and 1.6. It's easy to set the -source
and -target
options so that the syntax is forced to be a particular version, and the output class is interpretable by a particular VM. But there are other version-isms that are biting me, like the 2-argument constructor AssertionError(String, Throwable)
and various other subtle changes.
The one solution I know of is to install every different JDK (1.5, 1.6, 1.7) so that Eclipse can exactly match the execution environment for me. Is there any other way to detect these problems? Bonus points if it's an Eclipse or Maven tool.
Upvotes: 3
Views: 119
Reputation: 14951
How about the Codehaus anmial-sniffer maven plugin? I haven't had reason to try it yet, but thought it looked interesting.
Upvotes: 1
Reputation: 15791
does this tool help? It's command line, I have seen people using it to detect java7 being used.
Upvotes: 0