edu.rice.cs.util.newjvm
Class ExecJVM
java.lang.Object
|
+--edu.rice.cs.util.newjvm.ExecJVM
- public final class ExecJVM
- extends Object
A utility class to allow executing another JVM.
- Version:
- $Id: ExecJVM.java,v 1.1 2002/04/14 05:34:21 brianstoler Exp $
Constructor Summary |
private |
ExecJVM()
|
Method Summary |
private static void |
_addArray(LinkedList list,
Object[] array)
|
private static String |
_getExecutable()
Find the java executable. |
private static boolean |
_isDOS()
DOS/Windows family OS's use ; to separate paths. |
private static boolean |
_isNetware()
|
static Process |
runJVM(String mainClass,
String[] classParams,
String[] jvmParams)
Runs a new JVM. |
static Process |
runJVM(String mainClass,
String[] classParams,
String[] classPath,
String[] jvmParams)
Runs a new JVM. |
static Process |
runJVM(String mainClass,
String[] classParams,
String classPath,
String[] jvmParams)
Runs a new JVM. |
static Process |
runJVMPropogateClassPath(String mainClass,
String[] classParams)
Runs a new JVM, propogating the present classpath. |
static Process |
runJVMPropogateClassPath(String mainClass,
String[] classParams,
String[] jvmParams)
Runs a new JVM, propogating the present classpath. |
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
PATH_SEPARATOR
private static final String PATH_SEPARATOR
OS_NAME
private static final String OS_NAME
ExecJVM
private ExecJVM()
runJVM
public static Process runJVM(String mainClass,
String[] classParams,
String[] classPath,
String[] jvmParams)
throws IOException
- Runs a new JVM.
- Parameters:
mainClass
- Class to runclassParams
- Parameters to pass to the main classclassPath
- Array of items to put in classpath of new JVMjvmParams
- Array of additional command-line parameters to pass to JVM- Returns:
Process
object corresponding to the executed JVM
runJVM
public static Process runJVM(String mainClass,
String[] classParams,
String classPath,
String[] jvmParams)
throws IOException
- Runs a new JVM.
- Parameters:
mainClass
- Class to runclassParams
- Parameters to pass to the main classclassPath
- Pre-formatted classpath parameterjvmParams
- Array of additional command-line parameters to pass to JVM- Returns:
Process
object corresponding to the executed JVM
runJVMPropogateClassPath
public static Process runJVMPropogateClassPath(String mainClass,
String[] classParams,
String[] jvmParams)
throws IOException
- Runs a new JVM, propogating the present classpath.
- Parameters:
mainClass
- Class to runclassParams
- Parameters to pass to the main classjvmParams
- Array of additional command-line parameters to pass to JVM- Returns:
Process
object corresponding to the executed JVM
runJVMPropogateClassPath
public static Process runJVMPropogateClassPath(String mainClass,
String[] classParams)
throws IOException
- Runs a new JVM, propogating the present classpath.
- Parameters:
mainClass
- Class to runclassParams
- Parameters to pass to the main class- Returns:
Process
object corresponding to the executed JVM
runJVM
public static Process runJVM(String mainClass,
String[] classParams,
String[] jvmParams)
throws IOException
- Runs a new JVM.
- Parameters:
mainClass
- Class to runclassParams
- Parameters to pass to the main classjvmParams
- Array of additional command-line parameters to pass to JVM- Returns:
Process
object corresponding to the executed JVM
_addArray
private static void _addArray(LinkedList list,
Object[] array)
_isDOS
private static boolean _isDOS()
- DOS/Windows family OS's use ; to separate paths.
_isNetware
private static boolean _isNetware()
_getExecutable
private static String _getExecutable()
- Find the java executable.
This logic comes from Ant.