IntelliJ 2018.1首选项中的“使用'--release'选项”是什么? [英] What is the “Use '--release' option” in IntelliJ 2018.1 preferences?
问题描述
在IntelliJ 2018.1的首选项中(构建,执行,部署>编译器> Java编译器)是一个复选框,标记为:
In the preferences for IntelliJ 2018.1 (Build, Execution, Deployment > Compiler > Java Compiler) is an checkbox labeled:
使用' --release'选项用于交叉编译(Java 9和更高版本)
Use '--release' option for cross-compilation (Java 9 and later)
我在进行Internet搜索时发现了信息。 ?单击帮助图标会出现404错误。
I found for information when doing an internet search. The "?" help icon give a 404 error when clicked.
此选项的目的/功能是什么?
What is the purpose/function of this option?
< a href = https://i.stack.imgur.com/c0kzE.jpg rel = noreferrer>
推荐答案
帮助部分可以在此处找到:
默认情况下,此选项处于选中状态。 IntelliJ IDEA在需要交叉编译并且
自动为Java 9应用--release编译器选项时,从
项目设置中推断出。
By default, this option is selected. IntelliJ IDEA deduces from project settings when the cross-compilation is needed and automatically applies the --release compiler option for Java 9.
什么是-release
选项?这是一个新的命令行选项,在 JEP 247:为较早的平台版本进行编译 。
What is the --release
option? It is a new command-line option, defined in JEP 247: Compile for Older Platform Versions.
定义了新的命令行选项
-release
,其中自动配置编译器以生成将链接到给定平台版本的实现的类文件。
A new command-line option,
--release
, is defined, which automatically configures the compiler to produce class files that will link against an implementation of the given platform version.
在此这里的答案很好。
还要检查 IDEA-184333 关于为什么在IDE中添加此选项的背景信息。简而言之,有些用户只需要为其项目指定-源
和 -target
版本,而无需设置 -bootclasspath
选项。
Also check IDEA-184333 for the background why this option was added in the IDE. In short, some users need to specify only -source
and -target
versions for their projects without also setting the -bootclasspath
option.
这篇关于IntelliJ 2018.1首选项中的“使用'--release'选项”是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!