1JAOTC(1) JDK Commands JAOTC(1)
2
3
4
6 jaotc - The Java static compiler that produces native code for compiled
7 Java methods
8
10 jaotc [options] [name | list]
11
12 options
13 Command-line options separated by spaces. See jaotc Options.
14
15 name The Java class or jar file from which Java methods will be com‐
16 piled.
17
18 list Colon (:) separated list of class names, modules, jar files or
19 directories which contain class files.
20
22 The jaotc command is a Java Ahead-Of-Time (AOT) static compiler which
23 produces native code in the form of a shared library for the Java meth‐
24 ods in specified Java class files. The Java Virtual Machine can load
25 these AOT libraries and use native code from them when corresponding
26 Java methods are called. By using jaotc, there is no need to wait for
27 the JIT compiler to generate (by compiling bytecode) the fast native
28 code for these Java methods. The code is already generated by jaotc
29 and ready to be immediately used. For the same reason, there is no
30 need to execute these methods in the Interpreter because fast compiled
31 native code can be executed instead.
32
33 Note:
34
35 The jaotc command is experimental. See JEP 295: Ahead-of-Time Compila‐
36 tion [https://openjdk.java.net/jeps/295] for complete details.
37
39 --output file
40 Output file name. Default name is "unnamed.so".
41
42 --class-name class-names
43 List of Java classes to compile.
44
45 --jar jar-files
46 List of JAR files to compile.
47
48 --module modules
49 List of Java modules to compile.
50
51 --directory dirs
52 List of directories to search for files to compile.
53
54 --search-path dirs
55 List of directories to search for specified files.
56
57 --compile-commands file
58 Name of the file containing the compile commands:
59
60 exclude
61 Excludes compilation of specified methods.
62
63 compileOnly
64 Compiles only specified methods.
65
66 Regular expressions are used to specify classes and methods.
67 For example:
68
69 exclude sun.util.resources..*.TimeZoneNames_.*.getContents\(\)\[\[Ljava/lang/Object;
70 exclude sun.security.ssl.*
71 compileOnly java.lang.String.*
72
73 --compile-for-tiered
74 Generates profiling code for tiered compilation. By default,
75 profiling code is not generated (could be changed in a future).
76
77 --compile-with-assertions
78 Generates code with java assertions. By default, assertions
79 code is not generated.
80
81 --compile-threads number
82 Sets the number of compilation threads used. The default value
83 is min(16, available_cpus).
84
85 --ignore-errors
86 Ignores all exceptions thrown during class loading. By default,
87 the tool will exit compilation if class loading throws an excep‐
88 tion.
89
90 --exit-on-error
91 Exits on compilation errors. By default, failed compilation is
92 skipped and compilation of other methods continues.
93
94 --info Prints information about compilation phases.
95
96 --verbose
97 Prints more details about compilation phases.
98
99 --debug
100 Prints comprehensive details.
101
102 --help or -h or -?
103 Prints a summary of standard options and exits the tool.
104
105 --version
106 Prints version information.
107
108 -Jflag Provides a flag to pass to the runtime system. To pass more
109 than one flag, provide an instance of this option for each flag
110 or flag argument needed.
111
113 Use the jaotc tool to execute AOT compilation.
114
115 jaotc --output libHelloWorld.so HelloWorld.class
116
117 Specify a generated AOT library during application execution:
118
119 java -XX:+UnlockExperimentalVMOptions -XX:AOTLibrary=./libHelloWorld.so HelloWorld
120
121
122
123JDK 16 2020 JAOTC(1)