public Process exec(String prog,String[] envp,File directory) throws java.io.IOException {
  if (prog == null) {
    throw new NullPointerException();
  }
  if (prog.length() == 0) {
    throw new IllegalArgumentException();
  }
  if (envp != null) {
    if (envp.length != 0) {
      for (int i=0; i < envp.length; i++) {
        if (envp[i] == null) {
          throw new NullPointerException("An element of envp shouldn't be empty.");
        }
      }
    }
 else {
      envp=null;
    }
  }
  StringTokenizer st=new StringTokenizer(prog);
  String[] progArray=new String[st.countTokens()];
  int i=0;
  while (st.hasMoreTokens()) {
    progArray[i++]=st.nextToken();
  }
  return exec(progArray,envp,directory);
}

public Process exec ( String prog , String [ ] envp , File directory ) throws java . io . IOException { if ( prog == null ) { throw new NullPointerException ( ) ; } if ( prog . length ( ) == 0 ) { throw new IllegalArgumentException ( ) ; } if ( envp != null ) { if ( envp . length != 0 ) { for ( int i = 0 ; i < envp . length ; i ++ ) { if ( envp [ i ] == null ) { throw new NullPointerException ( "An element of envp shouldn't be empty." ) ; } } } else { envp = null ; } } StringTokenizer st = new StringTokenizer ( prog ) ; String [ ] progArray = new String [ st . countTokens ( ) ] ; int i = 0 ; while ( st . hasMoreTokens ( ) ) { progArray [ i ++ ] = st . nextToken ( ) ; } return exec ( progArray , envp , directory ) ; }
execute prog in a separate platform process the new process uses the environment provided in envp
