You won't be able to run the JDK 1.5 compiled code in JVM 1.4; the JVM will throw an error if you try. The way to do it is to use Retroweaver or a similar backwards-compatibility tool. Retroweaver works by replacing any calls to the Java API that are specific to 1.5 with their 1.4 equivalents, then compiling with JDK 1.4. Personally I haven't come across any issues using it, but you can check for potential pitfalls on their Sourceforge site.