langtools/src/share/classes/com/sun/tools/javac/Main.java
changeset 19252 83c32c7f747b
parent 16303 b5dca0b42963
child 19919 ffb2cc047744
equal deleted inserted replaced
19251:c3b7abd43bc0 19252:83c32c7f747b
    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      *