NOTE: Please do not comment on all the perils of cross-compiling. Thank you.
I have a situation where we need to have Java 6 source compiled for a Java 5 JVM (to be sure that JAX-WS usage is correct). Previously we have done this with ant ant script (which apparently can), but after migrating to Maven we have found that it ends up with javac complaining:
$ javac -source 1.6 -target 1.5
javac: source release 1.6 requires target release 1.6
Is there any Java distribution for Linux (Ubuntu 11.10, x86) where the javac can do this?
EDIT: It appears not, as the limitation is in javac which is the same. The solution (which made this need go away) was to change from the default javac compiler to the eclipse compiler in maven-compiler-plugin.
EDIT: I've found that the Eclipse compiler generates byte code for anonymous inner classes that the javadoc utility disagrees with. I am preparing a bug report for this issue.
source
param? Are using any class not available in Java5? – Maible-source 1.6
and can't use-source 1.5
? Java Programming Language Enhancements says No language changes were introduced in Java SE 6. – Jiles