Browse Source

Added maxmemory attribute to <java>.

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@267861 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 25 years ago
parent
commit
9174fbde3b
2 changed files with 18 additions and 0 deletions
  1. +7
    -0
      docs/index.html
  2. +11
    -0
      src/main/org/apache/tools/ant/taskdefs/Java.java

+ 7
- 0
docs/index.html View File

@@ -1672,6 +1672,13 @@ the one that is currently running Ant.</p>
disabled)</td>
<td align="center" valign="top">No</td>
</tr>
<tr>
<td valign="top">maxmemory</td>
<td valign="top">Max amount of memory to allocate to the forked VM
(ignored if fork is disabled)</td>
<td align="center" valign="top">all</td>
<td align="center" valign="top">No</td>
</tr>
<tr>
<td valign="top">failonerror</td>
<td valign="top">Stop the buildprocess if the command exits with a


+ 11
- 0
src/main/org/apache/tools/ant/taskdefs/Java.java View File

@@ -200,6 +200,17 @@ public class Java extends Task {
this.dir = d;
}

/**
* -mx or -Xmx depending on VM version
*/
public void setMaxmemory(String max){
if (Project.getJavaVersion().startsWith("1.1")) {
createJvmarg().setValue("-mx"+max);
} else {
createJvmarg().setValue("-Xmx"+max);
}
}

/**
* Executes the given classname with the given arguments as it
* was a command line application.


Loading…
Cancel
Save