My Oracle Support Banner

How To Enforce a JDK Installed In a Specific Directory Be Used In ANT Build Script (Doc ID 382934.1)

Last updated on FEBRUARY 13, 2024

Applies to:

Oracle Containers for J2EE - Version and later
Information in this document applies to any platform.


ANT scrips frequently include at least one target to compile java classes.

What "javac"  executable is picked up for compilation is normally controlled by naming its directory as one of the execute directories in the PATH environment variable.

For example:  <ORACLE_HOME>/jdk/bin:<ORACLE_HOME>/bin:<ORACLE_HOME>/opmn/bin:<ORACLE_HOME>/dcm/bin:<ORACLE_HOME>/OPatch:/usr/bin:/bin:/usr/sbin

But the goal of this note is to show an alternative way to accomplish this.


To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!

In this Document

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.