tags:

views:

123

answers:

1

I need to find a good way to build for JDK 1.1.8. So far I've tried using Eclipse, IntelliJ and Ant with no luck. With Ant (v 1.7.1) I tried setting the relevant parameters on the javac task (executable and compiler). Trouble is this:

[javac] This version of java does not support the classic compiler; upgrading to modern.

Is there a way to make Ant work, or perhaps some other way?

+6  A: 

Set the target="1.1" and source="1.3" attributes on the javac ant task (source=1.3 is required for target=1.1).

Note that this will give you 1.1-compatible class files, but you still need to make sure you don't use any APIs or features not supported in your target JVM.

Edit: As pointed out by Andrew Thompson, you can use the bootclasspath option to make javac compile against 1.1.8 APIs (note that in JDK 1.1.8, the runtime library was called classes.zip, not rt.jar).

Grodriguez
To ensure the missing "APIs or features" problem does not trip up the build, also specify a -bootclasspath pointing to a 1.1.8 rt.jar.
Andrew Thompson
Yes it works! Please incorporate the comment into the answer to make it complete.
Arne Evertsson
Thanks Andrew, I've updated the answer with the `bootclasspath` information.
Grodriguez