If I compile an application using Java 5 code into bytecode, are the resulting .class files going to be able to run under Java 1.4?
If the latter can wo
No. You can only move upwards - Java 1.4 bytecode will work on Java 5 runtimes. However, if you aren't using any functionality not found in Java 1.4, you can compile using the -target
and -source
options of javac.
If you want to use Java 5 to write an application that can be run on Java 4, you can't use any features that weren't present before Java 5.