Package com.logicaldoc.util.exec
Class JavaLauncher
java.lang.Object
com.logicaldoc.util.exec.JavaLauncher
JavaLauncher Provides an easy way to launch java applications.
-
Constructor Details
-
JavaLauncher
public JavaLauncher()
-
-
Method Details
-
exec
public static Process exec(String mainClass, String classpath, String[] jvmargs, String[] properties) throws ExecException Launch a java program.- Parameters:
mainClass- - class with main methodclasspath- - the java classpathjvmargs- - arguments for the jvmproperties- - any system properties- Returns:
- the launched process
- Throws:
ExecException- Error in executing the given command
-
execJar
Execute a java jar file that contains a manifest.- Parameters:
pathToJar- - absolute path to your jarjvmargs- - arguments for the java virtual machine- Returns:
- Process The launched process
- Throws:
ExecException- An error happened during execution
-
findJVM
Find a suitable JVM on the user's system.- Returns:
- - path to java binary
-
main
Demo - Launch a java program.- Parameters:
args- the invocation arguments
-