This solved one dilemma that I faced. I like JDK 1.5 features but some of my old Java applications are dependant on some proprietary libraries which can only run on JDK 1.4.
Retroweaver is a bytecode weaver that enables you to take advantage of the new Java 1.5 language features, while still retaining total binary compatability with 1.4 virtual machines. Retroweaver operates by transforming Java class files compiled by a 1.5 compiler into version 1.4 class files which can then be run on any 1.4 virtual machine.
As quoted from the website, Retroweaver supports most 1.5 features while running on 1.4.
- extended for loops
- static imports
Retrotranslator is another tool that you can use for this.