[英]IntelliJ IDEA 2016 project change java sdk version from 7 to 8
The external libraries in Project window shows that the project was using jdk7. “项目”窗口中的外部库显示该项目正在使用jdk7。 Then I change the jdk version in File > Other settings > Default project structure> SDKs, by adding jdk 8 from its installed location. 然后,通过从安装位置添加jdk 8,在“文件”>“其他设置”>“默认项目结构”>“ SDK”中更改jdk版本。 Now java 7 is gone, but java 8 does not show up and it could not compile. 现在Java 7消失了,但是Java 8没有出现并且无法编译。 Is this a bug or did I miss anything? 这是一个错误还是我错过了任何事情? if I add java 7 then it comes back in External Libraries: 如果我添加了Java 7,那么它将在外部库中返回:
您还必须调整模块本身的依赖关系/删除旧的1.7库并从新的SDK添加
change the module settings indeed. 确实更改模块设置。 Right click on the module (which I understand it as project in Eclipse I guess) and click Open module settings (F4 shortcut), and on tab dependencies, change it to 1.8, originally it was blank. 右键单击该模块(我猜我将其理解为Eclipse中的项目),然后单击“打开模块设置”(F4快捷方式),然后在选项卡依存关系上将其更改为1.8,最初是空白。 (If it was blank shouldn't it be using the project settings which is already configured as java 8, but no, for some reason it still use java 7) (如果为空白,则不应使用已经配置为Java 8的项目设置,但不能,因为某些原因它仍使用Java 7)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.