Documentation Contents

NAME

apt - annotation processing tool

SYNOPSIS

apt [-classpath classpath] [-sourcepath sourcepath] [-d directory] [-s directory] [-factorypath path] [-factory class] [-print] [-nocompile] [-Akey[=val] ...] [javac option] sourcefiles [@files]

PARAMETERS

Options may be in any order. For a discussion of parameters which apply to a specific option, see OPTIONS below.

sourcefiles
Zero or more source files to be processed.
@files
One or more files that list source files or other options

DESCRIPTION

Note: The apt tool and its associated API contained in the package com.sun.mirror have been deprecated since JDK 7 and are planned to be removed in the next major JDK release. Use the options available in the javac tool and the APIs contained in the packages javax.annotation.processing and javax.lang.model to process annotations.

The tool apt, annotation processing tool, includes reflective APIs and supporting infrastructure to process program annotations. The apt reflective APIs provide a build-time, source-based, read-only view of program structure. These reflective APIs are designed to cleanly model the Java™ programming language's type system after the addition of generics. First, apt runs annotation processors that can produce new source code and other files. Next, apt can cause compilation of both original and generated source files, easing development. The reflective APIs and other APIs used to interact with the tool are subpackages of com.sun.mirror.

A fuller discussion of how the tool operates as well as instructions for developing with apt are in Getting Started with apt.

OPTIONS

apt specific options

-s dir
Specify the directory root under which processor-generated source files will be placed; files are placed in subdirectories based on package namespace.
-nocompile
Do not compile source files to class files.
-print
Print out textual representation of specified types; perform no annotation processing or compilation.
-A[key[=val]]
Options to pass to annotation processors -- these are not interpreted by apt directly, but are made available for use by individual processors
-factorypath path
Specify where to find annotation processor factories; if this option is used, the classpath is not searched for factories.
-factory classname
Name of annotation processor factory to use; bypasses default discovery process
-version
Print version information.
-X
Display information about non-standard options.

Options shared with javac

-d dir
Specify where to place processor and javac generated class files
-cp path or -classpath path
Specify where to find user class files and annotation processor factories. If -factorypath is given, the classpath is not searched for factories.

Consult the javac(1) man page for information on javac options.

Non-Standard Options

-XListAnnotationTypes
List found annotation types.
-XListDeclarations
List specified and included declarations.
-XPrintAptRounds
Print information about initial and recursive apt rounds.
-XPrintFactoryInfo
Print information about which annotations a factory is asked to process.
-XclassesAsDecls
Treat both class and source files as declarations to process.

Note: Because these options are non-standard, they are subject to change without notice.

NOTES

The apt tool and its associated API contained in the package com.sun.mirror have been deprecated since JDK 7 and are planned to be removed in the next major JDK release. Use the options available in the javac tool and the APIs contained in the packages javax.annotation.processing and javax.lang.model to process annotations.

SEE ALSO


Oracle and/or its affiliates Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.
Contact Us