Module jdk.compiler

module jdk.compiler
Defines the implementation of the system Java compiler and its command line equivalent, javac.

javac

This module provides the equivalent of command-line access to javac via the ToolProvider and Tool service provider interfaces (SPIs), and more flexible access via the JavaCompiler SPI.

Instances of the tools can be obtained by calling ToolProvider.findFirst or the service loader with the name "javac".

In addition, instances of JavaCompiler.CompilationTask obtained from JavaCompiler can be downcast to JavacTask for access to lower level aspects of javac, such as the Abstract Syntax Tree (AST).

This module uses the FileSystemProvider API to locate file system providers. In particular, this means that a jar file system provider, such as that in the jdk.zipfs module, must be available if the compiler is to be able to read JAR files.

Module Graph:
Module graph for jdk.compilerModule graph for jdk.compiler
Tool Guides:
javac
Since:
9

Packages

Package Description
com.sun.source.doctree
Provides interfaces to represent documentation comments as abstract syntax trees (AST).
com.sun.source.tree
Provides interfaces to represent source code as abstract syntax trees (AST).
com.sun.source.util
Provides utilities for operations on abstract syntax trees (AST).
com.sun.tools.javac
This package provides a legacy entry point for the javac tool.
From Packages
java.compiler javax.annotation.processing javax.lang.model javax.lang.model.element javax.lang.model.type javax.lang.model.util javax.tools

Modules

Modifier Module Description
transitive java.compiler
Defines the Language Model, Annotation Processing, and Java Compiler APIs.

Services

Type Description
JavaCompiler
Tool
ToolProvider
Type Description
Plugin
The interface for a javac plug-in.
Processor
The interface for an annotation processor.

© 1993, 2021, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/17/docs/api/jdk.compiler/module-summary.html