Name
java
Synopsis
Executes a Java class using Ant’s VM instance or by
forking a new VM process. If the executed application calls
System.exit( ), be sure to set
fork="true" or Ant will exit.
Attributes
-
args(all, String, N) Deprecated in Ant 1.2; use nested
<arg>elements instead.-
classname(all, String, *) The name of the Java class to execute.
-
classpath(all, Path, N) The classpath to use. This is added to Ant’s classpath unless
fork="true".-
classpathref(all, Reference, N) A reference to a classpath defined elsewhere in the buildfile.
-
dir(all, File, N) The working directory for the VM. Ignored unless
fork="true".-
failonerror(all, boolean, N) If
true, the build fails when the command returns anything other than 0. Defaults tofalse. Ignored unlessfork="true".-
fork(all, boolean, N) If
true, the class is executed in a new VM instance. Defaults tofalse.-
jar(1.4, File, *) The name of an executable JAR file to execute. The JAR file must contain a
Main-Classmanifest entry, andforkmust betrue.-
jvm(all, String, N) The command name of the Java interpreter (may be a full pathname to the command). Defaults to
java. Ignored unlessfork="true".-
jvmargs(all, String, N) Deprecated in Ant 1.2; use nested
<jvmarg>elements instead.-
maxmemory(all, String, N) Maximum amount of memory allocated for the forked VM. Ignored unless
fork="true". Equivalent to-mxor-XmxJava command-line options, depending on which version of Java is in use.-
output(1.3, 1.4, File, N) A filename to write output to.
Either ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access