Setting the JDK for an Ant Script
See Also
When you run Ant from inside the IDE, Ant runs on the JDK on which the IDE
is running. For example, if you are using version 1.4 of the Java platform,
your Ant scripts use the version 1.4 compiler executable and libraries to compile
files.
The IDE does not contain options for setting the JDK that Ant uses. If you
want to run Ant with a different JDK, you have to set it to do so in the Ant
script itself.
To set the Java platform used by an Ant script in compilation:
- Open your Ant script in the Source Editor and go to the javac task
that compiles your source files.
- Add one of the following attributes to the task:
- bootclasspath. Use this attribute to compile
against a different Java platform's libraries but still use the compiler
executable of the IDE's Java platform.
- executable. Use this attribute to use the compiler
executable and libraries for a specific Java platform. If you use the
executable attribute you do not have to set the bootclasspath
attribute.
- compiler. Use this attribute to use a different implementation
of the compiler, such as Jikes.
Legal Notices