Package javax.tools
These interfaces and classes are required as part of the Java Platform, Standard Edition (Java SE), but there is no requirement to provide any tools implementing them.
Unless explicitly allowed, all methods in this package might throw aNullPointerException if given anull argument or if given alist or collection containingnull elements. Similarly, no method may returnnull unless explicitly allowed.
This package is the home of the Java programming language compiler framework. This framework allows clients of the framework to locate and run compilers from programs. The framework also provides Service Provider Interfaces (SPI) for structured access to diagnostics (DiagnosticListener) as well as a file abstraction for overriding file access (JavaFileManager andJavaFileObject). SeeJavaCompiler for more details on using the SPI.
There is no requirement for a compiler at runtime. However, if a default compiler is provided, it can be located using theToolProvider, for example:
JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
It is possible to provide alternative compilers or tools through theservice provider mechanism.
For example, ifcom.vendor.VendorJavaCompiler is a provider of theJavaCompiler tool then its jar file would contain the file META-INF/services/javax.tools.JavaCompiler. This file would contain the single line:
com.vendor.VendorJavaCompiler
If the jar file is on the class path, VendorJavaCompiler can be located using code like this:
JavaCompiler compiler = ServiceLoader.load(JavaCompiler.class).iterator().next();
- Since:
- 1.6
- Interface SummaryInterfaceDescriptionDiagnostic<S>Interface for diagnostics from tools.Interface for receiving diagnostics from tools.Interface to invoke Java programming language documentation tools from programs.Interface representing a future for a documentation task.File abstraction for tools.Interface to invoke Java programming language compilers from programs.Interface representing a future for a compilation task.File manager for tools operating on Java programming language source and class files.Interface for locations of file objects.File abstraction for tools operating on Java programming language source and class files.Interface for recognizing options.File manager based on
java.io.Fileandjava.nio.file.Path.Factory to createPathobjects from strings.Common interface for tools that can be invoked from a program. - Class SummaryClassDescriptionProvides an easy way to collect diagnostics in a list.ForwardingFileObject<F extendsFileObject>Forwards calls to a given file object.ForwardingJavaFileManager<M extendsJavaFileManager>Forwards calls to a given file manager.ForwardingJavaFileObject<F extendsJavaFileObject>Forwards calls to a given file object.Provides simple implementations for most methods in JavaFileObject.Provides methods for locating tool providers, for example, providers of compilers.
- Enum Class SummaryEnum ClassDescriptionKinds of diagnostics, for example, error or warning.Locations specific to
DocumentationTool.Kinds of JavaFileObjects.Standard locations of file objects.