我正在开发一个简单的Java项目,并尝试首次使用IntelliJ 14;我通过教育许可证拥有Ultimate版本(在我本科的最后一年!)。我对Maven和IntelliJ都不是很熟悉。我想使用Java 8,实际上我相当确定这是我计算机上唯一安装的JDK版本。然而,无论何时编译我的项目,我都会收到几个警告和一个信息消息:
所以我注意到的是,在IntelliJ IDEA > Preferences... > Build, Execution, Deployment > Compiler > Java Compiler下,目标字节码版本设置为
以下是我已经完成的工作:
Information: Using javac 1.8.0_51 to compile java sources
Warning: java: source value 1.5 is obsolete and will be removed in a future release
Warning: java: target value 1.5 is obsolete and will be removed in a future release
所以我注意到的是,在IntelliJ IDEA > Preferences... > Build, Execution, Deployment > Compiler > Java Compiler下,目标字节码版本设置为
1.5
。我可以将其更改为1.8
,但是当我退出IntelliJ并重新打开项目时,它会重置为1.5
。项目字节码版本对SDK默认值为空。以下是我已经完成的工作:
在我的Maven pom中包含以下内容:
<properties> <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target> </properties>
根据IntelliJ网站此处的说明更改了IntelliJ偏好设置文件。
根据IntelliJ网站此处的说明设置了全局、项目和模块SDK。
我有什么设置遗漏了吗?我需要怎样做才能使这个值不在重启IntelliJ后被更改?