问题描述
在 IntelliJ 2018.1 的首选项(构建、执行、部署 > 编译器 > Java 编译器)中有一个复选框,标记为:
In the preferences for IntelliJ 2018.1 (Build, Execution, Deployment > Compiler > Java Compiler) is an checkbox labeled:
使用--release"选项进行交叉编译(Java 9 及更高版本)
我在网上搜索时找到了相关信息.这 "?"单击帮助图标时会出现 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?
推荐答案
帮助部分 可以在这里找到:
默认情况下,此选项处于选中状态.IntelliJ IDEA 从需要交叉编译时的项目设置和自动为 Java 9 应用 --release 编译器选项.
什么是 --release
选项?这是一个新的命令行选项,在 JEP 247: Compile for Older Platform Versions.
What is the --release
option? It is a new command-line option, defined in JEP 247: Compile for Older Platform Versions.
定义了一个新的命令行选项 --release
,它会自动配置编译器以生成将链接到给定平台版本的实现的类文件.
在此这里有很好的答案中进行了讨论.
另请查看 IDEA-184333 了解为什么在 IDE 中添加此选项的背景.简而言之,有些用户只需要为其项目指定-source
和-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' 选项"是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!