public static ProcessBuilder getProcessBuilder(String mainClass, List<URL> classPath, List<String> args) throws LauncherException
	{
		List<String> cmdList = new ArrayList<String>();
		String[] cmdArray;
		
		cmdList.add(getJavaPath());
		if(classPath != null && classPath.size() > 0)
		{
			cmdList.add("-cp");
			cmdList.add(mkPath(classPath));
		}
		cmdList.add(mainClass);
		if(args!=null && args.size()>0)
			cmdList.addAll(args);
		cmdArray = cmdList.toArray(new String[cmdList.size()]);
		if(logger.isDebugEnabled())
			logger.debug("cmdArray=" + Arrays.toString(cmdArray));
		return new ProcessBuilder(cmdArray);
	}
public static ProcessBuilder getProcessBuilder ( String mainClass , List < URL > classPath , List < String > args ) throws LauncherException { List < String > cmdList = new ArrayList < String > ( ) ; String [ ] cmdArray ; cmdList . add ( getJavaPath ( ) ) ; if ( classPath != null && classPath . size ( ) > 0 ) { cmdList . add ( "-cp" ) ; cmdList . add ( mkPath ( classPath ) ) ; } cmdList . add ( mainClass ) ; if ( args != null && args . size ( ) > 0 ) cmdList . addAll ( args ) ; cmdArray = cmdList . toArray ( new String [ cmdList . size ( ) ] ) ; if ( logger . isDebugEnabled ( ) ) logger . debug ( "cmdArray=" + Arrays . toString ( cmdArray ) ) ; return new ProcessBuilder ( cmdArray ) ; }
Get a process loader for a JVM.
@param mainClass Main class to run
@param classPath List of urls to use for the new JVM's
class path.
@param args Additional command line parameters
@return ProcessBuilder that has not been started.