Package org.apache.tools.ant.taskdefs
Class ExecuteJava
java.lang.Object
org.apache.tools.ant.taskdefs.ExecuteJava
- All Implemented Interfaces:
- Runnable,- TimeoutObserver
Execute a Java class.
- Since:
- Ant 1.2
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidExecute the Java class against the specified Ant Project.intfork(ProjectComponent pc) Run the Java command in a separate VM, this does not give you the full flexibility of the Java task, but may be enough for simple needs.booleanGet whether the process was killed.voidrun()Run this ExecuteJava in a Thread.voidsetClasspath(Path p) Set the classpath to be used when running the Java class.voidsetJavaCommand(Commandline javaCommand) Set the Java "command" for this ExecuteJava.voidsetOutput(PrintStream out) Deprecated.since 1.4.x.voidsetPermissions(Permissions permissions) Set the permissions for the application run.voidSet the system properties to use when running the Java class.voidsetTimeout(Long timeout) Set the timeout for this ExecuteJava.static voidsetupCommandLineForVMS(Execute exe, String[] command) On VMS platform, we need to create a special java options file containing the arguments and classpath for the java command.voidMark timeout as having occurred.
- 
Constructor Details- 
ExecuteJavapublic ExecuteJava()
 
- 
- 
Method Details- 
setJavaCommandSet the Java "command" for this ExecuteJava.- Parameters:
- javaCommand- the classname and arguments in a Commandline.
 
- 
setClasspathSet the classpath to be used when running the Java class.- Parameters:
- p- an Ant Path object containing the classpath.
 
- 
setSystemPropertiesSet the system properties to use when running the Java class.- Parameters:
- s- CommandlineJava system properties.
 
- 
setPermissionsSet the permissions for the application run.- Parameters:
- permissions- the Permissions to use.
- Since:
- Ant 1.6
 
- 
setOutputDeprecated.since 1.4.x. manage output at the task level.Set the stream to which all output (System.out as well as System.err) will be written.- Parameters:
- out- the PrintStream where output should be sent.
 
- 
setTimeoutSet the timeout for this ExecuteJava.- Parameters:
- timeout- timeout as Long.
- Since:
- Ant 1.5
 
- 
executeExecute the Java class against the specified Ant Project.- Parameters:
- project- the Project to use.
- Throws:
- BuildException- on error.
 
- 
runpublic void run()Run this ExecuteJava in a Thread.
- 
timeoutOccuredMark timeout as having occurred.- Specified by:
- timeoutOccuredin interface- TimeoutObserver
- Parameters:
- w- the responsible Watchdog.
- Since:
- Ant 1.5
 
- 
killedProcesspublic boolean killedProcess()Get whether the process was killed.- Returns:
- trueif the process was killed, false otherwise.
- Since:
- 1.19, Ant 1.5
 
- 
forkRun the Java command in a separate VM, this does not give you the full flexibility of the Java task, but may be enough for simple needs.- Parameters:
- pc- the ProjectComponent to use for logging, etc.
- Returns:
- the exit status of the subprocess.
- Throws:
- BuildException- on error.
- Since:
- Ant 1.6.3
 
- 
setupCommandLineForVMSOn VMS platform, we need to create a special java options file containing the arguments and classpath for the java command. The special file is supported by the "-V" switch on the VMS JVM.- Parameters:
- exe- the Execute instance to alter.
- command- the command-line.
 
 
-