equal
deleted
inserted
replaced
24 */ |
24 */ |
25 |
25 |
26 package com.sun.tools.javac; |
26 package com.sun.tools.javac; |
27 |
27 |
28 import java.io.PrintWriter; |
28 import java.io.PrintWriter; |
29 import java.lang.reflect.*; |
|
30 |
|
31 |
29 |
32 /** |
30 /** |
33 * The programmatic interface for the Java Programming Language |
31 * The programmatic interface for the Java Programming Language |
34 * compiler, javac. |
32 * compiler, javac. |
35 * |
33 * |
42 * or deletion without notice. |
40 * or deletion without notice. |
43 */ |
41 */ |
44 @jdk.Supported |
42 @jdk.Supported |
45 public class Main { |
43 public class Main { |
46 |
44 |
47 /** Unsupported command line interface. |
45 /** Main entry point for the launcher. |
48 * @param args The command line parameters. |
46 * Note: This method calls System.exit. |
|
47 * @param args command line arguments |
49 */ |
48 */ |
50 public static void main(String[] args) throws Exception { |
49 public static void main(String[] args) throws Exception { |
51 if (args.length > 0 && args[0].equals("-Xjdb")) { |
|
52 String[] newargs = new String[args.length + 2]; |
|
53 Class<?> c = Class.forName("com.sun.tools.example.debug.tty.TTY"); |
|
54 Method method = c.getDeclaredMethod ("main", new Class<?>[] {args.getClass()}); |
|
55 method.setAccessible(true); |
|
56 System.arraycopy(args, 1, newargs, 3, args.length - 1); |
|
57 newargs[0] = "-connect"; |
|
58 newargs[1] = "com.sun.jdi.CommandLineLaunch:options=-esa -ea:com.sun.tools..."; |
|
59 newargs[2] = "com.sun.tools.javac.Main"; |
|
60 method.invoke(null, new Object[] { newargs }); |
|
61 } else { |
|
62 System.exit(compile(args)); |
50 System.exit(compile(args)); |
63 } |
|
64 } |
51 } |
65 |
52 |
66 /** Programmatic interface to the Java Programming Language |
53 /** Programmatic interface to the Java Programming Language |
67 * compiler, javac. |
54 * compiler, javac. |
68 * |
55 * |