langtools/src/share/opensource/javac/doc/javac_lifecycle/Main.html
author duke
Sat, 01 Dec 2007 00:00:00 +0000
changeset 10 06bc494ca11e
permissions -rw-r--r--
Initial load
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
06bc494ca11e Initial load
duke
parents:
diff changeset
     2
<!--
06bc494ca11e Initial load
duke
parents:
diff changeset
     3
Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
06bc494ca11e Initial load
duke
parents:
diff changeset
     4
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
06bc494ca11e Initial load
duke
parents:
diff changeset
     5
06bc494ca11e Initial load
duke
parents:
diff changeset
     6
This code is free software; you can redistribute it and/or modify it
06bc494ca11e Initial load
duke
parents:
diff changeset
     7
under the terms of the GNU General Public License version 2 only, as
06bc494ca11e Initial load
duke
parents:
diff changeset
     8
published by the Free Software Foundation.  Sun designates this
06bc494ca11e Initial load
duke
parents:
diff changeset
     9
particular file as subject to the "Classpath" exception as provided
06bc494ca11e Initial load
duke
parents:
diff changeset
    10
by Sun in the LICENSE file that accompanied this code.
06bc494ca11e Initial load
duke
parents:
diff changeset
    11
06bc494ca11e Initial load
duke
parents:
diff changeset
    12
This code is distributed in the hope that it will be useful, but WITHOUT
06bc494ca11e Initial load
duke
parents:
diff changeset
    13
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
06bc494ca11e Initial load
duke
parents:
diff changeset
    14
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
06bc494ca11e Initial load
duke
parents:
diff changeset
    15
version 2 for more details (a copy is included in the LICENSE file that
06bc494ca11e Initial load
duke
parents:
diff changeset
    16
accompanied this code).
06bc494ca11e Initial load
duke
parents:
diff changeset
    17
06bc494ca11e Initial load
duke
parents:
diff changeset
    18
You should have received a copy of the GNU General Public License version
06bc494ca11e Initial load
duke
parents:
diff changeset
    19
2 along with this work; if not, write to the Free Software Foundation,
06bc494ca11e Initial load
duke
parents:
diff changeset
    20
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
06bc494ca11e Initial load
duke
parents:
diff changeset
    21
06bc494ca11e Initial load
duke
parents:
diff changeset
    22
Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
06bc494ca11e Initial load
duke
parents:
diff changeset
    23
CA 95054 USA or visit www.sun.com if you need additional information or
06bc494ca11e Initial load
duke
parents:
diff changeset
    24
have any questions.
06bc494ca11e Initial load
duke
parents:
diff changeset
    25
-->
06bc494ca11e Initial load
duke
parents:
diff changeset
    26
06bc494ca11e Initial load
duke
parents:
diff changeset
    27
<html>
06bc494ca11e Initial load
duke
parents:
diff changeset
    28
    <head>
06bc494ca11e Initial load
duke
parents:
diff changeset
    29
        <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
06bc494ca11e Initial load
duke
parents:
diff changeset
    30
        <meta name="author" content="Jonathan Gibbons">
06bc494ca11e Initial load
duke
parents:
diff changeset
    31
        <link type="text/css" rel="stylesheet" href="style.css">
06bc494ca11e Initial load
duke
parents:
diff changeset
    32
        <title>Main</title>
06bc494ca11e Initial load
duke
parents:
diff changeset
    33
    </head>
06bc494ca11e Initial load
duke
parents:
diff changeset
    34
    <body>
06bc494ca11e Initial load
duke
parents:
diff changeset
    35
06bc494ca11e Initial load
duke
parents:
diff changeset
    36
        <h3>com.sun.tools.javac.main.Main</h3>
06bc494ca11e Initial load
duke
parents:
diff changeset
    37
06bc494ca11e Initial load
duke
parents:
diff changeset
    38
        <p>
06bc494ca11e Initial load
duke
parents:
diff changeset
    39
            The normal main entry point is
06bc494ca11e Initial load
duke
parents:
diff changeset
    40
            <a href="../../src/share/classes/com/sun/tools/javac/main/Main.java" class=code>com.sun.tools.javac.main.Main</a>,
06bc494ca11e Initial load
duke
parents:
diff changeset
    41
            with a public API entry point at
06bc494ca11e Initial load
duke
parents:
diff changeset
    42
            <a href="../../src/share/classes/com/sun/tools/javac/Main.java" class=code>com.sun.tools.javac.Main</a> which just calls down to <code>com.sun.tools.javac.main.Main</code>.
06bc494ca11e Initial load
duke
parents:
diff changeset
    43
        </p>
06bc494ca11e Initial load
duke
parents:
diff changeset
    44
06bc494ca11e Initial load
duke
parents:
diff changeset
    45
        <p>The various parts of the compiler share common information by means of a 
06bc494ca11e Initial load
duke
parents:
diff changeset
    46
        <a href="../../src/share/classes/com/sun/tools/javac/util/Context.java" class=code>Context</a>.
06bc494ca11e Initial load
duke
parents:
diff changeset
    47
        Every invocation of the compiler must have its own Context.
06bc494ca11e Initial load
duke
parents:
diff changeset
    48
06bc494ca11e Initial load
duke
parents:
diff changeset
    49
        <p>
06bc494ca11e Initial load
duke
parents:
diff changeset
    50
            <code>com.sun.tools.javac.main.Main</code> does command line processing to determine the list of files to be compiled, and any applicable options. There are four types of options: 
06bc494ca11e Initial load
duke
parents:
diff changeset
    51
            <ul>
06bc494ca11e Initial load
duke
parents:
diff changeset
    52
                <li>standard public options, e.g. <code>-classpath</code>
06bc494ca11e Initial load
duke
parents:
diff changeset
    53
                <li>extended public options, beginning -X, e.g. <code>-Xlint</code>
06bc494ca11e Initial load
duke
parents:
diff changeset
    54
                <li>hidden options -- not public or documented, e.g. -fullversion
06bc494ca11e Initial load
duke
parents:
diff changeset
    55
                <li>even more hidden options -- typically for debugging the compiler, beginning -XD, e.g. -XDrawDiagnostics
06bc494ca11e Initial load
duke
parents:
diff changeset
    56
            </ul>
06bc494ca11e Initial load
duke
parents:
diff changeset
    57
06bc494ca11e Initial load
duke
parents:
diff changeset
    58
            If there are files to be compiled, <code>Main</code> invokes
06bc494ca11e Initial load
duke
parents:
diff changeset
    59
            <a href="../../src/share/classes/com/sun/tools/javac/main/JavaCompiler.java" class=code>JavaCompiler</a> <i>(<a href="JavaCompiler.html">more...</a>)</i>
06bc494ca11e Initial load
duke
parents:
diff changeset
    60
            After <code>JavaCompiler</code> completes, the list of class symbols that was returned is discarded.
06bc494ca11e Initial load
duke
parents:
diff changeset
    61
        </p>
06bc494ca11e Initial load
duke
parents:
diff changeset
    62
06bc494ca11e Initial load
duke
parents:
diff changeset
    63
        <p>
06bc494ca11e Initial load
duke
parents:
diff changeset
    64
        Any and all exceptions are caught and handled, and a return code is
06bc494ca11e Initial load
duke
parents:
diff changeset
    65
        determined. Finally, the compiler exits.
06bc494ca11e Initial load
duke
parents:
diff changeset
    66
        <p>
06bc494ca11e Initial load
duke
parents:
diff changeset
    67
    </body>
06bc494ca11e Initial load
duke
parents:
diff changeset
    68
</html>
06bc494ca11e Initial load
duke
parents:
diff changeset
    69