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