IntelliJ 2018.1 首选项中的“使用‘--release’选项”是什么?

What is the “Use '--release' option” in IntelliJ 2018.1 preferences?

在 IntelliJ 2018.1 的首选项中(构建、执行、部署 > 编译器 > Java 编译器)是一个标记为:

的复选框

Use '--release' option for cross-compilation (Java 9 and later)

我在网上搜索时找到了资料。这 ”?”单击帮助图标时出现 404 错误。

这个选项的purpose/function是什么?

帮助部分can be found here:

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 选项是什么?这是一个新的 command-line 选项,在 JEP 247: Compile for Older Platform Versions 中定义。

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 中添加此选项的背景。简而言之,有些用户只需要为他们的项目指定 -source-target 版本,而无需同时设置 -bootclasspath 选项。