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 $

Field Summary
private static String OS_NAME
           
private static String PATH_SEPARATOR
           
 
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
 

Field Detail

PATH_SEPARATOR

private static final String PATH_SEPARATOR

OS_NAME

private static final String OS_NAME
Constructor Detail

ExecJVM

private ExecJVM()
Method Detail

runJVM

public static Process runJVM(String mainClass,
                             String[] classParams,
                             String[] classPath,
                             String[] jvmParams)
                      throws IOException
Runs a new JVM.
Parameters:
mainClass - Class to run
classParams - Parameters to pass to the main class
classPath - Array of items to put in classpath of new JVM
jvmParams - 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 run
classParams - Parameters to pass to the main class
classPath - Pre-formatted classpath parameter
jvmParams - 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 run
classParams - Parameters to pass to the main class
jvmParams - 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 run
classParams - 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 run
classParams - Parameters to pass to the main class
jvmParams - 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.