Arne Evertsson
Arne Evertsson

Reputation: 19827

How to build for JDK 1.1.8?

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?

Upvotes: 8

Views: 1189

Answers (1)

Grodriguez
Grodriguez

Reputation: 22015

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).

Upvotes: 6

Related Questions