/** * If set, system properties will be copied to the cloned VM--as * well as the bootclasspath unless you have explicitly specified * a bootclasspath. * * <p>Doesn't have any effect unless fork is true.</p> * @param cloneVm if true copy system properties. * @since Ant 1.7 */ public void setCloneVm(boolean cloneVm) { getCommandLine().setCloneVm(cloneVm); }
/** * Adds a JVM argument. * * @return JVM argument created. */ public Commandline.Argument createJvmarg() { return getCommandLine().createVmArgument(); }
/** * Set the JVM version. * @param value JVM version. */ public void setJVMVersion(String value) { getCommandLine().setVmversion(value); }
/** * Add a system property. * * @param sysp system property. */ public void addSysproperty(Environment.Variable sysp) { getCommandLine().addSysproperty(sysp); }
/** * Add assertions to enable in this program (if fork=true). * @param asserts assertion set. * @since Ant 1.6 */ public void addAssertions(Assertions asserts) { if (getCommandLine().getAssertions() != null) { throw new BuildException("Only one assertion declaration is allowed"); } getCommandLine().setAssertions(asserts); }
/** * Clear out the arguments to this java task. */ public void clearArgs() { getCommandLine().clearJavaArgs(); }
/** * Do the execution and return a return code. * * @return the return code from the execute java class if it was * executed in a separate VM (fork = "yes") or a security manager was * installed that prohibits ExitVM (default). * * @throws BuildException if required parameters are missing. */ public int executeJava() throws BuildException { return executeJava(getCommandLine()); }
/** * Add a command-line argument. * * @return created argument. */ public Commandline.Argument createArg() { return getCommandLine().createArgument(); }
/** * Add a set of properties as system properties. * * @param sysp set of properties to add. * * @since Ant 1.6 */ public void addSyspropertyset(PropertySet sysp) { getCommandLine().addSyspropertyset(sysp); }
/** * Set the command used to start the VM (only if forking). * * @param s command to start the VM. */ public void setJvm(String s) { getCommandLine().setVm(s); }
/** * Corresponds to -mx or -Xmx depending on VM version. * * @param max max memory parameter. */ public void setMaxmemory(String max) { getCommandLine().setMaxmemory(max); }
/** * Get the system properties of the command line. * * @return the current properties of this java invocation. * @since 1.6.3 */ public CommandlineJava.SysProperties getSysProperties() { return getCommandLine().getSystemProperties(); }
/** * Set the Java class to execute. * * @param s the name of the main class. * * @throws BuildException if there is also a {@code jar} or {@code sourcefile} attribute specified */ public void setClassname(String s) throws BuildException { if (getCommandLine().getJar() != null || getCommandLine().getSourceFile() != null) { throw new BuildException( "Cannot use combination of 'jar', 'classname', sourcefile attributes in same command"); } getCommandLine().setClassname(s); }
/** * Set the Java module to execute. * * @param module the name of the module. * * @throws BuildException if there is also a {@code jar} or {@code sourcefile} attribute specified * @since 1.9.7 */ public void setModule(String module) throws BuildException { if (getCommandLine().getJar() != null || getCommandLine().getSourceFile() != null) { throw new BuildException( "Cannot use combination of 'jar', 'module', sourcefile attributes in same command"); } getCommandLine().setModule(module); }
/** * Add a path to the modulepath. * * @return created modulepath. * @since 1.9.7 */ public Path createModulepath() { return getCommandLine().createModulepath(getProject()).createPath(); }
/** * Add a path to the classpath. * * @return created classpath. */ public Path createClasspath() { return getCommandLine().createClasspath(getProject()).createPath(); }
/** * Deprecated: use nested arg instead. * Set the command line arguments for the class. * * @param s arguments. * * @ant.attribute ignore="true" */ public void setArgs(String s) { log("The args attribute is deprecated. Please use nested arg elements.", Project.MSG_WARN); getCommandLine().createArgument().setLine(s); }
/** * Add a path to the bootclasspath. * @since Ant 1.6 * * @return created bootclasspath. */ public Path createBootclasspath() { return getCommandLine().createBootclasspath(getProject()).createPath(); }
/** * Set the command line arguments for the JVM. * * @param s jvmargs. */ public void setJvmargs(String s) { log("The jvmargs attribute is deprecated. Please use nested jvmarg elements.", Project.MSG_WARN); getCommandLine().createVmArgument().setLine(s); }
/** * Add a path to the upgrademodulepath. * * @return created upgrademodulepath. * @since 1.9.7 */ public Path createUpgrademodulepath() { return getCommandLine().createUpgrademodulepath(getProject()).createPath(); }