equal
deleted
inserted
replaced
195 @SuppressWarnings("fallthrough") |
195 @SuppressWarnings("fallthrough") |
196 public synchronized boolean compile(String argv[]) { |
196 public synchronized boolean compile(String argv[]) { |
197 String sourcePathArg = null; |
197 String sourcePathArg = null; |
198 String classPathArg = null; |
198 String classPathArg = null; |
199 String sysClassPathArg = null; |
199 String sysClassPathArg = null; |
200 String extDirsArg = null; |
|
201 boolean verbosePath = false; |
200 boolean verbosePath = false; |
202 |
201 |
203 String targetArg = null; |
202 String targetArg = null; |
204 short majorVersion = JAVA_DEFAULT_VERSION; |
203 short majorVersion = JAVA_DEFAULT_VERSION; |
205 short minorVersion = JAVA_DEFAULT_MINOR_VERSION; |
204 short minorVersion = JAVA_DEFAULT_MINOR_VERSION; |
340 } else { |
339 } else { |
341 error("main.option.requires.argument","-bootclasspath"); |
340 error("main.option.requires.argument","-bootclasspath"); |
342 usage_error(); |
341 usage_error(); |
343 return false; // Stop processing now |
342 return false; // Stop processing now |
344 } |
343 } |
345 } else if (argv[i].equals("-extdirs")) { |
|
346 if ((i + 1) < argv.length) { |
|
347 if (extDirsArg != null) { |
|
348 error("main.option.already.seen","-extdirs"); |
|
349 } |
|
350 extDirsArg = argv[++i]; |
|
351 } else { |
|
352 error("main.option.requires.argument","-extdirs"); |
|
353 usage_error(); |
|
354 return false; // Stop processing now |
|
355 } |
|
356 } else if (argv[i].equals("-encoding")) { |
344 } else if (argv[i].equals("-encoding")) { |
357 if ((i + 1) < argv.length) { |
345 if ((i + 1) < argv.length) { |
358 if (encoding!=null) |
346 if (encoding!=null) |
359 error("main.option.already.seen","-encoding"); |
347 error("main.option.already.seen","-encoding"); |
360 encoding = argv[++i]; |
348 encoding = argv[++i]; |
473 |
461 |
474 // Create our Environment. |
462 // Create our Environment. |
475 BatchEnvironment env = BatchEnvironment.create(out, |
463 BatchEnvironment env = BatchEnvironment.create(out, |
476 sourcePathArg, |
464 sourcePathArg, |
477 classPathArg, |
465 classPathArg, |
478 sysClassPathArg, |
466 sysClassPathArg); |
479 extDirsArg); |
|
480 if (verbosePath) { |
467 if (verbosePath) { |
481 output(getText("main.path.msg", |
468 output(getText("main.path.msg", |
482 env.sourcePath.toString(), |
469 env.sourcePath.toString(), |
483 env.binaryPath.toString())); |
470 env.binaryPath.toString())); |
484 } |
471 } |
501 try { |
488 try { |
502 // Parse all input files |
489 // Parse all input files |
503 for (Enumeration<String> e = v.elements() ; e.hasMoreElements() ;) { |
490 for (Enumeration<String> e = v.elements() ; e.hasMoreElements() ;) { |
504 File file = new File(e.nextElement()); |
491 File file = new File(e.nextElement()); |
505 try { |
492 try { |
506 env.parseFile(new ClassFile(file)); |
493 env.parseFile(ClassFile.newClassFile(file)); |
507 } catch (FileNotFoundException ee) { |
494 } catch (FileNotFoundException ee) { |
508 env.error(0, "cant.read", file.getPath()); |
495 env.error(0, "cant.read", file.getPath()); |
509 exitStatus = EXIT_CMDERR; |
496 exitStatus = EXIT_CMDERR; |
510 } |
497 } |
511 } |
498 } |