在IntelliJ 2018.1(构建,执行,部署>编译器>
Java编译器)的首选项中,有一个标记为的复选框:
Use ‘–release’ option for cross-compilation (Java 9 and later)
我在网上搜索时找到了相关信息. “?”单击帮助图标时出现404错误.
这个选项的目的/功能是什么?
解决方法
帮助部分
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选项?它是一个新的命令行选项,在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.
在good answer here讨论.
另请参阅IDEA-184333以了解IDE中添加此选项的背景.简而言之,一些用户只需为其项目指定-source和-target版本,而无需设置-bootclasspath选项.