addSysproperty
public void addSysproperty(Environment.Variable sysp)
Add a system property.
sysp
- a property to be set in the JVM.
addSyspropertyset
public void addSyspropertyset(PropertySet sysp)
Add a set of system properties.
sysp
- a set of properties.
clearJavaArgs
public void clearJavaArgs()
Clear out the java arguments.
clone
public Object clone()
throws CloneNotSupportedException
Deep clone the object.
- a CommandlineJava object.
createArgument
public Commandline.Argument createArgument()
Create a new argument to the java program.
- an argument to be configured.
createBootclasspath
public Path createBootclasspath(Project p)
Create a boot classpath.
p
- the project to use to create the path.
createClasspath
public Path createClasspath(Project p)
Create a classpath.
p
- the project to use to create the path.
createVmArgument
public Commandline.Argument createVmArgument()
Create a new JVM argument.
- an argument to be configured.
describeCommand
public String describeCommand()
Return a String that describes the command and arguments suitable for
verbose output before a call to Runtime.exec(String[])
.
describeJavaCommand
public String describeJavaCommand()
Return a String that describes the java command and arguments
for in-VM executions.
The class name is the executable in this context.
getActualVMCommand
protected Commandline getActualVMCommand()
Get the VM command parameters, including memory settings.
- the VM command parameters.
getAssertions
public Assertions getAssertions()
Get the current assertions.
getBootclasspath
public Path getBootclasspath()
Get the boot classpath.
getClassname
public String getClassname()
Get the name of the class to be run.
- the name of the class to run or null if there is no class.
getClasspath
public Path getClasspath()
Get the classpath for the command.
getCommandline
public String[] getCommandline()
Get the command line to run a Java vm.
- the list of all arguments necessary to run the vm.
getJar
public String getJar()
Get the name of the jar to be run.
- the pathname of the jar file to run via -jar option
or null if there is no jar to run.
getJavaCommand
public Commandline getJavaCommand()
Get the Java command to be used.
- the java command--not a clone.
getVmCommand
public Commandline getVmCommand()
Get the VM command, including memory.
- A deep clone of the instance's VM command, with memory settings added.
getVmversion
public String getVmversion()
Get the vm version.
haveBootclasspath
protected boolean haveBootclasspath(boolean log)
Determine whether the bootclasspath has been specified, and whether it
shall really be used (build.sysclasspath could be set or the VM may not
support it).
log
- whether to log a warning if a bootclasspath has been
specified but will be ignored.
- true if the bootclasspath is to be used.
haveClasspath
protected boolean haveClasspath()
Determine whether the classpath has been specified, and whether it shall
really be used or be nulled by build.sysclasspath.
- true if the classpath is to be used.
restoreSystemProperties
public void restoreSystemProperties()
throws BuildException
Restore the cached system properties.
BuildException
- if Security prevented this operation, or
there was no system properties to restore
setAssertions
public void setAssertions(Assertions assertions)
Add an assertion set to the command.
assertions
- assertions to make.
setClassname
public void setClassname(String classname)
Set the classname to execute.
classname
- the fully qualified classname.
setCloneVm
public void setCloneVm(boolean cloneVm)
Set whether system properties will be copied to the cloned VM--as
well as the bootclasspath unless you have explicitly specified
a bootclasspath.
cloneVm
- if true copy the system properties.
setJar
public void setJar(String jarpathname)
Set a jar file to execute via the -jar option.
jarpathname
- the pathname of the jar to execute.
setMaxmemory
public void setMaxmemory(String max)
Specify max memory of the JVM.
-mx or -Xmx depending on VM version.
max
- the string to pass to the jvm to specifiy the max memory.
setSystemProperties
public void setSystemProperties()
throws BuildException
Cache current system properties and set them to those in this
Java command.
setVm
public void setVm(String vm)
Set the executable used to start the new JVM.
vm
- the executable to use.
setVmversion
public void setVmversion(String value)
Set the JVM version required.
value
- the version required.
size
public int size()
since 1.7.
Please dont use this, it effectively creates the
entire command.
Get the size of the java command line. This is a fairly intensive
operation, as it has to evaluate the size of many components.
- the total number of arguments in the java command line.
toString
public String toString()
Get a string description.
- the command line as a string.