Class c = null; try { c = Thread.currentThread().getContextClassLoader().loadClass( args[i]); } catch (ClassNotFoundException e) { System.err.println(args[i] + " class not found."); System.exit(1); }
Class c = compiler.loadClass(args[i]);
  public static void main(String[] args)  {    boolean noWrite = false;    boolean verbose = false;    String HelpPath = "giop/GRMIC.txt";    HelpPrinter.checkHelpKey(args, HelpPath);    File output = new File(".");    if (args.length == 0)      {        HelpPrinter.printHelpAndExit(HelpPath);      }    else      {        GiopRmicCompiler compiler = new GiopRmicCompiler();        int cl = - 1;        Options: for (int i = 0; i < args.length; i++)          {            String c = args[i];            if (c.equals("-poa"))              compiler.setPoaMode(true);            else if (c.equals("-impl"))              compiler.setPoaMode(false);            else if (c.equals("-v"))              {                printVersion();                System.exit(0);              }            else if (c.equals("-nowrite"))              noWrite = true;            else if (c.equals("-nowarn"))              compiler.setWarnings(false);            else if (c.equals("-verbose"))              {                verbose = true;                compiler.setVerbose(true);              }            else if (c.equals("-force"))              {                compiler.setForce(true);              }            else if (c.equals("-d"))              {                int f = i + 1;                if (f < args.length)                  {                    output = new File(args[f]);                    i++;                  }                else                  HelpPrinter.printHelpAndExit(HelpPath);              }            else if (c.charAt(0) != '-')            // No more options - start of class list.              {                cl = i;                break Options;              }          }        if (cl < 0)          HelpPrinter.printHelpAndExit(HelpPath);        if (verbose)          System.out.println("Compiling to " + output.getAbsolutePath());        // Compile classes        Compile: for (int i = cl; i < args.length; i++)          {            if (args[i].charAt(0) != '-')              {                compiler.reset();                Class c = null;                try                  {                    c = Thread.currentThread().getContextClassLoader().loadClass(                                                                                 args[i]);                  }                catch (ClassNotFoundException e)                  {                    System.err.println(args[i] + " class not found.");                    System.exit(1);                  }                compiler.compile(c);                String packag = compiler.getPackageName().replace('.', '/');                File fw = new File(output, packag);                // Generate stub.                String stub = compiler.generateStub();                String subName = "_" + compiler.getStubName() + "_Stub.java";                compiler.reset();                compiler.compile(c);                // Generate tie                String tie = compiler.generateTie();                String tieName = "_" + compiler.name(c) + "_Tie.java";                if (noWrite)                  continue Compile;                try                  {                    fw.mkdirs();                    OutputStream out = new FileOutputStream(new File(fw,                                                                     subName));                    out.write(stub.getBytes());                    out.close();                    out = new FileOutputStream(new File(fw, tieName));                    out.write(tie.getBytes());                    out.close();                  }                catch (IOException ioex)                  {                    System.err.println("Output path not accessible");                    ioex.printStackTrace();                    System.exit(1);                  }              }          }      }  }