1 /* 2 * Copyright (c) 2014, 2019, 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 * 31 * <h2 style="font-family:'DejaVu Sans Mono', monospace; font-style:italic">javac</h2> 32 * 33 * <p> 34 * This module provides the equivalent of command-line access to <em>javac</em> 35 * via the {@link java.util.spi.ToolProvider ToolProvider} and 36 * {@link javax.tools.Tool} service provider interfaces (SPIs), 37 * and more flexible access via the {@link javax.tools.JavaCompiler JavaCompiler} 38 * SPI.</p> 39 * 40 * <p> Instances of the tools can be obtained by calling 41 * {@link java.util.spi.ToolProvider#findFirst ToolProvider.findFirst} 42 * or the {@linkplain java.util.ServiceLoader service loader} with the name 43 * {@code "javac"}. 44 * 45 * <p> 46 * In addition, instances of {@link javax.tools.JavaCompiler.CompilationTask} 47 * obtained from {@linkplain javax.tools.JavaCompiler JavaCompiler} can be 48 * downcast to {@link com.sun.source.util.JavacTask JavacTask} for access to 49 * lower level aspects of <em>javac</em>, such as the 50 * {@link com.sun.source.tree Abstract Syntax Tree} (AST).</p> 51 * 52 * <p>This module uses the {@link java.nio.file.spi.FileSystemProvider 53 * FileSystemProvider} API to locate file system providers. In particular, 54 * this means that a jar file system provider, such as that in the 55 * {@code jdk.zipfs} module, must be available if the compiler is to be able 56 * to read JAR files. 57 * 58 * @toolGuide javac 59 * 60 * @provides java.util.spi.ToolProvider 61 * @provides com.sun.tools.javac.platform.PlatformProvider 62 * @provides javax.tools.JavaCompiler 63 * @provides javax.tools.Tool 64 * 65 * @uses javax.annotation.processing.Processor 66 * @uses com.sun.source.util.Plugin 67 * @uses com.sun.tools.javac.platform.PlatformProvider 68 * 69 * @moduleGraph 70 * @since 9 71 */ 72 module jdk.compiler { 73 requires transitive java.compiler; 74 75 exports com.sun.source.doctree; 76 exports com.sun.source.tree; 77 exports com.sun.source.util; 78 exports com.sun.tools.javac; 79 80 exports com.sun.tools.doclint to 81 jdk.javadoc; 82 exports com.sun.tools.javac.api to 83 jdk.javadoc, 84 jdk.jshell; 85 exports com.sun.tools.javac.resources to 86 jdk.jshell; 87 exports com.sun.tools.javac.code to 88 jdk.javadoc, 89 jdk.jshell; 90 exports com.sun.tools.javac.comp to 91 jdk.javadoc, 92 jdk.jshell; 93 exports com.sun.tools.javac.file to 94 jdk.jdeps, 95 jdk.javadoc; 96 exports com.sun.tools.javac.jvm to 97 jdk.javadoc; 98 exports com.sun.tools.javac.main to 99 jdk.javadoc, 100 jdk.jshell; 101 exports com.sun.tools.javac.model to 102 jdk.javadoc; 103 exports com.sun.tools.javac.parser to 104 jdk.jshell; 105 exports com.sun.tools.javac.platform to 106 jdk.jdeps, 107 jdk.javadoc; 108 exports com.sun.tools.javac.tree to 109 jdk.javadoc, 110 jdk.jshell; 111 exports com.sun.tools.javac.util to 112 jdk.jdeps, 113 jdk.javadoc, 114 jdk.jshell; 115 exports jdk.internal.shellsupport.doc to 116 jdk.jshell; 117 118 uses javax.annotation.processing.Processor; 119 uses com.sun.source.util.Plugin; 120 uses com.sun.tools.javac.platform.PlatformProvider; 121 122 provides java.util.spi.ToolProvider with 123 com.sun.tools.javac.main.JavacToolProvider; 124 125 provides com.sun.tools.javac.platform.PlatformProvider with 126 com.sun.tools.javac.platform.JDKPlatformProvider; 127 128 provides javax.tools.JavaCompiler with 129 com.sun.tools.javac.api.JavacTool; 130 131 provides javax.tools.Tool with 132 com.sun.tools.javac.api.JavacTool; 133 } 134