Browse Source

Examples for specifying a JDK in <java> and <javac>.

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@419463 13f79535-47bb-0310-9956-ffa450edef68
master
Jan Materne 19 years ago
parent
commit
923355ba63
2 changed files with 36 additions and 13 deletions
  1. +22
    -10
      docs/manual/CoreTasks/java.html
  2. +14
    -3
      docs/manual/CoreTasks/javac.html

+ 22
- 10
docs/manual/CoreTasks/java.html View File

@@ -241,9 +241,9 @@ been revoked) the System.exit() call will be intercepted
and treated like indicated in <i>failonerror</i>.</p>
<p>Note:<br>
If you do not specify permissions,
a set of default permissions will be added to your Java invocation to make
a set of default permissions will be added to your Java invocation to make
sure that the ant run will continue or terminated as indicated by
<i>failonerror</i>. All permissions not granted per default will be
<i>failonerror</i>. All permissions not granted per default will be
checked by whatever security manager was already in place. exitVM will be
disallowed.
</p>
@@ -256,7 +256,7 @@ disallowed.
<p>You can control enablement of Java 1.4 assertions with an
<a href="../CoreTypes/assertions.html"><tt>&lt;assertions&gt;</tt></a>
subelement.</p>
<p>Assertion statements are currently ignored in non-forked mode.</p>

<p><em>since Ant 1.6.</em></p>
@@ -340,13 +340,13 @@ and with a maximum memory of 128MB. Any non zero return code breaks the build.
&lt;/classpath&gt;
&lt;/java&gt;
</pre>

Run the JAR dist/test.jar relative to the directory
<tt>${exec.dir}</tt>, this being the same directory into which the JVM
is to start up.

is to start up.

<pre> &lt;java classname=&quot;test.Main&quot;/&gt;</pre>
Runs a given class with the current classpath.

<pre>
&lt;java classname=&quot;test.Main&quot;
fork=&quot;yes&quot; &gt;
@@ -355,12 +355,24 @@ is to start up.
&lt;jvmarg value=&quot;-Xrunhprof:cpu=samples,file=log.txt,depth=3&quot;/&gt;
&lt;/java&gt;
</pre>
<strong>Note</strong>: you can not specify the (highly deprecated) MSJVM, "jview.exe" as the
Add system properties and JVM-properties to the JVM as in
<code>java ="-Xrunhprof:cpu=samples,file=log.txt,depth=3 -DDEBUG=true test.Main</code>

<pre> &lt;java classname=&quot;ShowJavaVersion&quot; classpath=&quot;.&quot;
jvm=&quot;path-to-java14-home/bin/java&quot; fork=&quot;true&quot;
taskname=&quot;java1.4&quot; &gt;
</pre>
Use a given Java implementation (another the one Ant is currently using) to run the class.
For documentation in the log <code>taskname</code> is used to change the <code>[java]</code>
log-prefix to <code>[java1.4]</code>.


<p><strong>Note</strong>: you can not specify the (highly deprecated) MSJVM, "jview.exe" as the
JVM, as it takes different parameters for other JVMs,
That JVM can be started from <code>&lt;exec&gt;</code> if required.
That JVM can be started from <code>&lt;exec&gt;</code> if required.</p>
<hr>
<p align="center">Copyright &copy; 2000-2005 The Apache Software Foundation. All rights
<p align="center">Copyright &copy; 2000-2006 The Apache Software Foundation. All rights
Reserved.</p>

</body>
</html>
</html>

+ 14
- 3
docs/manual/CoreTasks/javac.html View File

@@ -34,7 +34,7 @@ attributes. With the <code>includes</code> or
have included.
The <code>exclude</code> or <code>excludesfile</code> attribute is used
to specify
the files you want to have excluded. In both cases, the list of files
the files you want to have excluded. In both cases, the list of files
can be specified by either the filename, relative to the directory(s) specified
in the <code>srcdir</code> attribute or nested <code>&lt;src&gt;</code>
element(s), or by using wildcard patterns. See the section on
@@ -369,7 +369,7 @@ supports all attributes of <code>&lt;fileset&gt;</code>
(<code>dir</code> becomes <code>srcdir</code>) as well as the nested
<code>&lt;include&gt;</code>, <code>&lt;exclude&gt;</code> and
<code>&lt;patternset&gt;</code> elements.</p>
<h4><code>src</code>, <code>classpath</code>, <code>sourcepath</code>,
<h4><code>src</code>, <code>classpath</code>, <code>sourcepath</code>,
<code>bootclasspath</code> and <code>extdirs</code></h4>
<p><code>&lt;javac&gt;</code>'s <code>srcdir</code>, <code>classpath</code>,
<code>sourcepath</code>, <code>bootclasspath</code>, and
@@ -540,6 +540,18 @@ directory but skip the examples. The compiler will even produce errors if some o
the non-example files refers to them.
</p>

<p>
If you wish to compile with a special JDK (another than the one Ant is currently using),
set the <code>executable</code> and <code>fork</code> attribute. Using <code>taskname</code>
could show in the log, that these settings are fix.
<pre> &lt;javac srcdir=&quot.&quot
destdir=&quot.&quot
executable=&quotpath-to-java14-home/bin/javac&quot
fork=&quottrue&quot
taskname=&quotjavac1.4&quot /&gt;</pre>
</p>


<p><b>Note:</b> If you are using Ant on Windows and a new DOS window pops up
for every use of an external compiler, this may be a problem of the JDK you are
using. This problem may occur with all JDKs &lt; 1.2.</p>
@@ -628,4 +640,3 @@ All rights Reserved.</p>

</body>
</html>


Loading…
Cancel
Save