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.
source
share