1apt(1) General Commands Manual apt(1)
2
3
4
6 apt - annotation processing tool
7
9 apt [-classpath classpath] [-sourcepath sourcepath] [-d directory] [-s
10 directory] [-factorypath path] [-factory class] [-print] [-nocompile]
11 [-Akey[=val] ...] [javac option] sourcefiles [@files]
12
14 Options may be in any order. For a discussion of parameters which apply
15 to a specific option, see OPTIONS below.
16
17 sourcefiles
18 Zero or more source files to be processed.
19
20 @files
21 One or more files that list source files or other options
22
24 The tool apt, annotation processing tool, includes a set of new reflec‐
25 tive APIs and supporting infrastructure to process program annotations.
26 The apt reflective APIs provide a build-time, source-based, read-only
27 view of program structure. These reflective APIs are designed to
28 cleanly model the Java(TM) programming language's type system after the
29 addition of generics. First, apt runs annotation processors that can
30 produce new source code and other files. Next, apt can cause compila‐
31 tion of both original and generated source files, easing development.
32 The reflective APIs and other APIs used to interact with the tool are
33 subpackages of com.sun.mirror.
34
35 A fuller discussion of how the tool operates as well as instructions
36 for developing with apt are in Getting Started with apt. @
37 http://java.sun.com/javase/6/docs/technotes/guides/apt/Get‐
38 tingStarted.html
39
40 Note:
41 The functionality of apt has been subsumed by the annotation-pro‐
42 cessing infrastructure that is now part of the javac tool [ Solaris
43 and Linux @
44 http://java.sun.com/javase/6/docs/tech‐
45 notes/tools/solaris/javac.html] [Windows] and standardized for use
46 by all Java compilers. This new infrastructure relies on the lan‐
47 guage model and annotation-processing APIs that are now part of the
48 Java Platform. It is recommended that new annotation processor
49 development be based on the new APIs and the javac tool.
50
52 apt specific options
53 -s dir
54 Specify the directory root under which processor-generated source
55 files will be placed; files are placed in subdirectories based on
56 package namespace.
57
58 -nocompile
59 Do not compile source files to class files.
60
61 -print
62 Print out textual representation of specified types; perform no
63 annotation processing or compilation.
64
65 -A[key[=val]]
66 Options to pass to annotation processors -- these are not inter‐
67 preted by apt directly, but are made available for use by individual
68 processors
69
70 -factorypath path
71 Specify where to find annotation processor factories; if this option
72 is used, the classpath is not searched for factories.
73
74 -factory classname
75 Name of annotation processor factory to use; bypasses default dis‐
76 covery process
77
78 Options shared with javac
79 -d dir
80 Specify where to place processor and javac generated class files
81
82 -cp path or -classpath
83 path Specify where to find user class files and annotation processor
84 factories. If -factorypath is given, the classpath is not searched
85 for factories.
86
87 Consult the javac(1) man page for information on javac options.
88
90 The functionality of apt has been subsumed by the standard annota‐
91 tion-processing infrastructure now offered by javac. Support for apt
92 and its associated APIs may be discontinued in some future JDK release.
93
95 * javac: [ Solaris and Linux @
96 http://java.sun.com/javase/6/docs/tech‐
97 notes/tools/solaris/javac.html] [Windows]
98
99 * java: [ Solaris @
100 http://java.sun.com/javase/6/docs/tech‐
101 notes/tools/solaris/java.html] [ Linux @
102 http://java.sun.com/javase/6/docs/technotes/tools/linux/java.html]
103 [Windows]
104
105
106 05 Aug 2006 apt(1)