Will code compiled using 1.5 and 1.6 run on a 1.4 JRE? We weren't sure which Java versions the 1.4 JRE supports.
We know that if the code in question implements 1.5 or 1.6 supported features then it definitely won't compile... and that there are some risks with "backwards compiling" but wasn't sure if the 1.4 JRE would refuse to even load the 1.5/1.6 compiled classes or not.
Update: I confirmed you get a java.lang.UnsupportedClassVersionError
exception if you run an 1.6 class file on JRE 1.4.
If you just build with the defaults of javac
1.6, your class files will not work on old versions of Java.
The best way to compile for older Java is just to use the older JDK releases. But if you really want to try to compile for older Java from newer, here are some instructions: