private Process executeCompiler(ArrayList<String> argList,ArrayList<String> envList,boolean chdir) throws IOException {
  String[] args;
  if (chdir) {
    CharBuffer cb=new CharBuffer();
    cb.append("cd ");
    cb.append(_compiler.getSourceDirName());
    cb.append(";");
    for (int i=0; i < argList.size(); i++) {
      cb.append(" ");
      cb.append(argList.get(i));
    }
    args=new String[3];
    args[0]="/bin/sh";
    args[1]="-c";
    args[2]=cb.toString();
  }
 else {
    args=new String[argList.size()];
    argList.toArray(args);
  }
  String[] envp=new String[envList.size()];
  envList.toArray(envp);
  if (log.isLoggable(Level.FINE)) {
    CharBuffer cb=CharBuffer.allocate();
    for (int i=0; i < args.length; i++) {
      if (i != 0)       cb.append(" ");
      cb.append(args[i]);
    }
    log.fine(cb.close());
  }
  Runtime runtime=Runtime.getRuntime();
  try {
    return runtime.exec(args);
  }
 catch (  Exception e) {
    throw new JavaCompileException(L.l("Can't execute the compiler `{0}'.  This usually means that the compiler is not in the operating system's PATH or the compiler is incorrectly specified in the configuration.  You may need to add the full path to <java compiler='{0}'/>.\n\n{1}",args[0],String.valueOf(e)));
  }
}

private Process executeCompiler ( ArrayList < String > argList , ArrayList < String > envList , boolean chdir ) throws IOException { String [ ] args ; if ( chdir ) { CharBuffer cb = new CharBuffer ( ) ; cb . append ( "cd " ) ; cb . append ( _compiler . getSourceDirName ( ) ) ; cb . append ( ";" ) ; for ( int i = 0 ; i < argList . size ( ) ; i ++ ) { cb . append ( " " ) ; cb . append ( argList . get ( i ) ) ; } args = new String [ 3 ] ; args [ 0 ] = "/bin/sh" ; args [ 1 ] = "-c" ; args [ 2 ] = cb . toString ( ) ; } else { args = new String [ argList . size ( ) ] ; argList . toArray ( args ) ; } String [ ] envp = new String [ envList . size ( ) ] ; envList . toArray ( envp ) ; if ( log . isLoggable ( Level . FINE ) ) { CharBuffer cb = CharBuffer . allocate ( ) ; for ( int i = 0 ; i < args . length ; i ++ ) { if ( i != 0 ) cb . append ( " " ) ; cb . append ( args [ i ] ) ; } log . fine ( cb . close ( ) ) ; } Runtime runtime = Runtime . getRuntime ( ) ; try { return runtime . exec ( args ) ; } catch ( Exception e ) { throw new JavaCompileException ( L . l ( "Can't execute the compiler `{0}'.  This usually means that the compiler is not in the operating system's PATH or the compiler is incorrectly specified in the configuration.  You may need to add the full path to <java compiler='{0}'/>.\n\n{1}" , args [ 0 ] , String . valueOf ( e ) ) ) ; } }
spawn the process to compile the file .
