没有合适的资源?快使用搜索试试~ 我知道了~
首页JDK 12工具参考手册:Java SE Release 12官方指南
JDK 12工具参考手册:Java SE Release 12官方指南
需积分: 5 0 下载量 198 浏览量
更新于2024-06-22
收藏 1.36MB PDF 举报
《JDK12 Tools Reference》是一份详细的文档,专门针对Java Platform, Standard Edition (JDK) Release 12进行介绍和指南。这份文档发布于2019年3月,版权属于Oracle及其关联公司,所有使用和披露均受许可协议限制,并受到知识产权法律保护。未经明确许可,用户不得进行复制、修改、分发等行为,除非法律另有规定,如为了兼容性目的进行反向工程、解剖或反编译。 该文档详细列出了Java 12工具集的功能和用法,包括但不限于开发工具(如javac编译器、javadoc注释生成器)、调试工具(如jdb调试器)、性能分析工具(如jconsole)以及构建工具(如Gradle或Maven集成)。它还可能涵盖了新特性,如模块化系统(Module System)、改进的垃圾回收算法、新的Lambda表达式和Stream API优化,这些都是Java 12的重要更新。 文档中强调了软件的许可证条款,指出在使用过程中如有发现错误,应通过书面形式报告给Oracle。对于在美国政府机构或由政府代理购买并使用的版本,文档中还包括了美国政府用户特别注意事项,表明其可能受到特定的法律和安全限制。 这份文档旨在帮助开发者高效地利用Java 12工具,提升开发效率,同时也提醒用户遵守相关法律法规,确保合规操作。随着技术的发展,文档中的内容可能会根据Oracle的更新而不断调整,因此持续关注官方文档是保持与最新版本Java平台兼容性的关键。
资源详情
资源推荐
-h directory
Specifies where to place generated native header files.
When you specify this option, a native header file is generated for each class that
contains native methods or that has one or more constants annotated with the
java.lang.annotation.Native annotation. If the class is part of a package, then
the compiler puts the native header file in a subdirectory that reflects the package
name and creates directories as needed.
--help
,
–help
or
-?
Prints a synopsis of the standard options.
--help-extra
or
-X
Prints the help for extra options.
-implicit:[none, class]
Specifies whether or not to generate class files for implicitly referenced files:
•
-implicit:class
— Automatically generates class files.
•
-implicit:none
— Suppresses class file generation.
If this option isn’t specified, then the default automatically generates class files. In this
case, the compiler issues a warning if any class files are generated when also doing
annotation processing. The warning isn’t issued when the
-implicit
option is
explicitly set. See Searching for Types.
-Joption
Passes
option
to the runtime system, where
option
is one of the Java options
described on javacommand. For example,
-J-Xms48m
sets the startup memory to 48
MB.
Note:
The
CLASSPATH
environment variable,
-classpath
option,
-bootclasspath
option, and
-extdirs
option don’t specify the classes used to run
javac
.
Trying to customize the compiler implementation with these options and
variables is risky and often doesn’t accomplish what you want. If you must
customize the complier implementation, then use the
-J
option to pass
options through to the underlying Java launcher.
--limit-modules module,module
*
Limits the universe of observable modules.
--module module-name
or
-m module-name
Compiles only the specified module and checks time stamps.
--module-path path
or
-p path
Specifies where to find application modules.
--module-source-path module-source-path
Specifies where to find input source files for multiple modules.
--module-version version
Specifies the version of modules that are being compiled.
Chapter 2
javac
2-6
-nowarn
Disables warning messages. This option operates the same as the
-Xlint:none
option.
-parameters
Generates metadata for reflection on method parameters. Stores formal parameter
names of constructors and methods in the generated class file so that the method
java.lang.reflect.Executable.getParameters
from the Reflection API can retrieve
them.
-proc:[none, only]
Controls whether annotation processing and compilation are done.
-proc:none
means that compilation takes place without annotation processing.
-proc:only
means that only annotation processing is done, without any subsequent compilation.
-processor class1[,class2,class3...]
Names of the annotation processors to run. This bypasses the default discovery
process.
--processor-module-path path
Specifies the module path used for finding annotation processors.
--processor-path path
or
-processorpath path
Specifies where to find annotation processors. If this option isn’t used, then the class
path is searched for processors.
-profile profile
Checks that the API used is available in the specified profile.
Note:
This can only be used when compiling for versions prior to JDK 9. As
applicable, see the descriptions in
--release
,
-source
, or
-target
for
details.
--release release
Compiles against the public, supported and documented API for a specific VM
version. Supported
release
targets are
7
,
8
,
9
,
10
,
11
, and
12
.
Note:
When using
--release
for a version of the Java Platform that supports
modules, you can’t use
--add-modules
to access internal JDK modules, nor
can you use
--add-exports
to access internal JDK APIs in the modules.
-s directory
Specifies the directory used to place the generated source files. If a class is part of a
package, then the compiler puts the source file in a subdirectory that reflects the
package name and creates directories as needed. For example:
Chapter 2
javac
2-7
• Oracle Solaris, Linux, and macOS: If you specify
-s /home/mysrc
and the class
is called
com.mypackage.MyClass
, then the source file is put in
/home/mysrc/com/
mypackage/MyClass.java
.
• Windows: If you specify
-s C:\mysrc
and the class is called
com.mypackage.MyClass
, then the source file is put in
C:\mysrc\com\mypackage
\MyClass.java
.
-source release
Specifies the version of source code accepted. The following values for
release
are
allowed:
Note:
Beginning with JDK 9,
javac
no longer supports
-source
release settings
less than or equal to
5
. If settings less than or equal to
5
are used, then the
javac
command behaves as if
-source 6
were specified.
1.6
No language changes were introduced in Java SE 6. However, encoding errors in
source files are now reported as errors instead of warnings as was done in earlier
releases of Java Platform, Standard Edition.
6
Synonym for 1.6.
1.7
The compiler accepts code with features introduced in Java SE 7.
7
Synonym for 1.7.
1.8
The compiler accepts code with features introduced in Java SE 8.
8
Synonym for 1.8.
9
The compiler accepts code with features introduced in Java SE 9.
10
The compiler accepts code with features introduced in Java SE 10.
11
The compiler accepts code with features introduced in Java SE 11.
12
The default value. The compiler accepts code with features introduced in Java SE
12.
--source-path path
or
-sourcepath path
Specifies where to find input source files. This is the source code path used to search
for class or interface definitions. As with the user class path, source path entries are
Chapter 2
javac
2-8
separated by colons (
:
) on Oracle Solaris, Linux, and macOS and semicolons (
;
) on
Windows. They can be directories, JAR archives, or ZIP archives. If packages are
used, then the local path name within the directory or archive must reflect the
package name.
Note:
Classes found through the class path might be recompiled when their
source files are also found. See Searching for Types.
--system jdk | none
Overrides the location of system modules.
-target release
Generates class files for a specific VM version.
--upgrade-module—path path
Overrides the location of upgradeable modules.
-verbose
Outputs messages about what the compiler is doing. Messages include information
about each class loaded and each source file compiled.
--version
or
-version
Prints version information.
-Werror
Terminates compilation when warnings occur.
Cross-Compilation Options for javac
By default, for releases prior to JDK 9, classes were compiled against the bootstrap
classes of the platform that shipped with the
javac
command. But
javac
also supports
cross-compiling, in which classes are compiled against bootstrap classes of a different
Java platform implementation. It’s important to use the
-bootclasspath
and
-extdirs
options when cross-compiling.
Note:
This can only be used when compiling for versions prior to JDK 9. As
applicable, see the descriptions in
--release
,
-source
, or
-target
for
details.
Extra Options
--add-exports module/package=other-module(,other-module)
*
Specifies a package to be considered as exported from its defining module to
additional modules or to all unnamed modules when the value of
other-module
is
ALL-UNNAMED
.
Chapter 2
javac
2-9
--add-reads module=other-module(,other-module)
*
Specifies additional modules to be considered as required by a given module.
--default-module-for-created-files module-name
Specifies the fallback target module for files created by annotation processors, if none
is specified or inferred.
-Djava.endorsed.dirs=dirs
Overrides the location of the endorsed standards path.
Note:
This can only be used when compiling for versions prior to JDK 9. As
applicable, see the descriptions in
--release
,
-source
, or
-target
for
details.
-Djava.ext.dirs=dirs
Overrides the location of installed extensions.
Note:
This can only be used when compiling for versions prior to JDK 9. As
applicable, see the descriptions in
--release
,
-source
, or
-target
for
details.
--doclint-format [html4|html5]
Specifies the format for documentation comments.
--patch-module module=file(:file)
*
Overrides or augments a module with classes and resources in JAR files or
directories.
-Xbootclasspath:path
Overrides the location of the bootstrap class files.
Note:
This can only be used when compiling for versions prior to JDK 9. As
applicable, see the descriptions in
--release
,
-source
, or
-target
for
details.
-Xbootclasspath/a:path
Adds a suffix to the bootstrap class path.
Chapter 2
javac
2-10
剩余291页未读,继续阅读
weixin_40191861_zj
- 粉丝: 67
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 收起
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
会员权益专享
最新资源
- 京瓷TASKalfa系列维修手册:安全与操作指南
- 小波变换在视频压缩中的应用
- Microsoft OfficeXP详解:WordXP、ExcelXP和PowerPointXP
- 雀巢在线媒介投放策划:门户网站与广告效果分析
- 用友NC-V56供应链功能升级详解(84页)
- 计算机病毒与防御策略探索
- 企业网NAT技术实践:2022年部署互联网出口策略
- 软件测试面试必备:概念、原则与常见问题解析
- 2022年Windows IIS服务器内外网配置详解与Serv-U FTP服务器安装
- 中国联通:企业级ICT转型与创新实践
- C#图形图像编程深入解析:GDI+与多媒体应用
- Xilinx AXI Interconnect v2.1用户指南
- DIY编程电缆全攻略:接口类型与自制指南
- 电脑维护与硬盘数据恢复指南
- 计算机网络技术专业剖析:人才培养与改革
- 量化多因子指数增强策略:微观视角的实证分析
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功