Check the project for using code introduced in Java 7

I have JDK 1.7 installed on my development machine, but we are packaging software for use with Java 1.5 and 1.6. Easy to set parameters -sourceand -targetto syntaxwas forced to be a specific version, and the output class is interpreted by a specific virtual machine. But there are other versions of isms that bite me, like a constructor with two arguments AssertionError(String, Throwable)and various other subtle changes.

The only solution I know is to install all the different JDKs (1.5, 1.6, 1.7) so that Eclipse can exactly match the runtime for me. Is there any other way to detect these problems? Bonus points if it is an Eclipse or Maven tool.

+3
source share
2 answers

What about Codehaus anmial-sniffer maven plugin ? I still had no reason to try this, but thought it looked interesting.

+1
source

does this tool help? On the command line, I saw people use it to discover which java7 is being used.

0
source

All Articles