Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to build for JDK 1.1.8?

Tags:

java

ant

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?

like image 520
Arne Evertsson Avatar asked Sep 29 '10 11:09

Arne Evertsson


1 Answers

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

like image 99
Grodriguez Avatar answered Oct 13 '22 21:10

Grodriguez