1 /* 2 * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. Oracle designates this 8 * particular file as subject to the "Classpath" exception as provided 9 * by Oracle in the LICENSE file that accompanied this code. 10 * 11 * This code is distributed in the hope that it will be useful, but WITHOUT 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 * version 2 for more details (a copy is included in the LICENSE file that 15 * accompanied this code). 16 * 17 * You should have received a copy of the GNU General Public License version 18 * 2 along with this work; if not, write to the Free Software Foundation, 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 * 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26 /** 27 * Defines the implementation of the 28 * {@linkplain javax.tools.ToolProvider#getSystemJavaCompiler system Java compiler} 29 * and its command line equivalent, <em>{@index javac javac tool}</em>, 30 * as well as <em>{@index javah javah tool}</em>. 31 * 32 * <h2 style="font-family:'DejaVu Sans Mono', monospace; font-style:italic">javac</h2> 33 * 34 * <p> 35 * This module provides the equivalent of command-line access to <em>javac</em> 36 * via the {@link java.util.spi.ToolProvider ToolProvider} and 37 * {@link javax.tools.Tool} service provider interfaces (SPIs), 38 * and more flexible access via the {@link javax.tools.JavaCompiler JavaCompiler} 39 * SPI.</p> 40 * 41 * <p> Instances of the tools can be obtained by calling 42 * {@link java.util.spi.ToolProvider#findFirst ToolProvider.findFirst} 43 * or the {@linkplain java.util.ServiceLoader service loader} with the name 44 * {@code "javac"}. 45 * 46 * <p> 47 * In addition, instances of {@link javax.tools.JavaCompiler.CompilationTask} 48 * obtained from {@linkplain javax.tools.JavaCompiler JavaCompiler} can be 49 * downcast to {@link com.sun.source.util.JavacTask JavacTask} for access to 50 * lower level aspects of <em>javac</em>, such as the 51 * {@link com.sun.source.tree Abstract Syntax Tree} (AST).</p> 52 * 53 * <p>This module uses the {@link java.nio.file.spi.FileSystemProvider 54 * FileSystemProvider} API to locate file system providers. In particular, 55 * this means that a jar file system provider, such as that in the 56 * {@code jdk.zipfs} module, must be available if the compiler is to be able 57 * to read JAR files. 58 * 59 * <dl style="font-family:'DejaVu Sans', Arial, Helvetica, sans serif"> 60 * <dt class="simpleTagLabel">Tool Guides: 61 * <dd>{@extLink javac_tool_reference javac} 62 * </dl> 63 * 64 * @provides java.util.spi.ToolProvider 65 * @provides com.sun.tools.javac.platform.PlatformProvider 66 * @provides javax.tools.JavaCompiler 67 * @provides javax.tools.Tool 68 * 69 * @uses javax.annotation.processing.Processor 70 * @uses com.sun.source.util.Plugin 71 * @uses com.sun.tools.javac.platform.PlatformProvider 72 * 73 * @moduleGraph 74 * @since 9 75 */ 76 module jdk.compiler { 77 requires transitive java.compiler; 78 79 exports com.sun.source.doctree; 80 exports com.sun.source.tree; 81 exports com.sun.source.util; 82 exports com.sun.tools.javac; 83 84 exports com.sun.tools.doclint to 85 jdk.javadoc; 86 exports com.sun.tools.javac.api to 87 jdk.javadoc, 88 jdk.jshell; 89 exports com.sun.tools.javac.code to 90 jdk.javadoc, 91 jdk.jshell; 92 exports com.sun.tools.javac.comp to 93 jdk.javadoc, 94 jdk.jshell; 95 exports com.sun.tools.javac.file to 96 jdk.jdeps, 97 jdk.javadoc; 98 exports com.sun.tools.javac.jvm to 99 jdk.javadoc; 100 exports com.sun.tools.javac.main to 101 jdk.javadoc, 102 jdk.jshell; 103 exports com.sun.tools.javac.model to 104 jdk.javadoc; 105 exports com.sun.tools.javac.parser to 106 jdk.jshell; 107 exports com.sun.tools.javac.platform to 108 jdk.jdeps, 109 jdk.javadoc; 110 exports com.sun.tools.javac.tree to 111 jdk.javadoc, 112 jdk.jshell; 113 exports com.sun.tools.javac.util to 114 jdk.jdeps, 115 jdk.javadoc, 116 jdk.jshell; 117 exports jdk.internal.shellsupport.doc to 118 jdk.jshell, 119 jdk.scripting.nashorn.shell; 120 121 uses javax.annotation.processing.Processor; 122 uses com.sun.source.util.Plugin; 123 uses com.sun.tools.javac.platform.PlatformProvider; 124 125 provides java.util.spi.ToolProvider with 126 com.sun.tools.javac.main.JavacToolProvider; 127 128 provides com.sun.tools.javac.platform.PlatformProvider with 129 com.sun.tools.javac.platform.JDKPlatformProvider; 130 131 provides javax.tools.JavaCompiler with 132 com.sun.tools.javac.api.JavacTool; 133 134 provides javax.tools.Tool with 135 com.sun.tools.javac.api.JavacTool; 136 } 137