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:

  1. Open your Ant script in the Source Editor and go to the javac task that compiles your source files.
  2. Add one of the following attributes to the task:
See Also
Ant Script Node
Running an Ant Script
Configuring Ant Settings

Legal Notices