compiling for old versions

i have the jdk5 (1.5.0.. whatever) and it wont run on a 1.4.2 RE, is there any way i can compile for an old version without just having 1.4.2 on a different machine and compiling on there (or having a lot of versions of it on this machine)
[246 byte] By [Ghelyara] at [2007-10-1 4:58:36]
# 1

The -source option of javac lets you specify the version of source code accepted. And using the -target option will generate class files that will work on VMs with the specified version.

Check documentation for details:

http://java.sun.com/j2se/1.5.0/docs/tooldocs/solaris/javac.html

TimTheEnchantora at 2007-7-9 5:33:01 > top of Java-index,Administration Tools,Sun Connection...
# 2
even if you compile for previous version, you can end up using classes, method or functionality which are not available in those versions.The only safe way to do this is to compile and test with the target version.
Peter-Lawreya at 2007-7-9 5:33:01 > top of Java-index,Administration Tools,Sun Connection...