如何更改IntelliJ IDEA默认JDK? [英] How do I change the IntelliJ IDEA default JDK?

查看:777
本文介绍了如何更改IntelliJ IDEA默认JDK?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用IntelliJ IDEA作为我的开发环境,使用Maven作为依赖管理。我经常在IDEA之外构建我的项目结构(目录,poms等),然后使用从外部模型导入项目将项目导入IDEA。这很好用,除了在我的poms中我指定maven-compiler-plugin应该使用JDK 1.6,当我导入时,IDEA通知我语言级别已更改语言级别更改将对项目重新加载生效,然后提示重新加载项目。这很烦人,因为我总是使用相同的JDK版本。

I use IntelliJ IDEA as my development environment, and Maven for dependency management. I frequently build my project structure (directories, poms, etc) outside of IDEA and then import the project into IDEA using Import project from external model. This works great, except that in my poms I specify that the maven-compiler-plugin should use JDK 1.6, and when I import, IDEA informs me that the Language Level Changed and that Language level changes will take effect on project reload, and then prompts to reload the project. This is annoying because I always use the same JDK version.

如何更改IntelliJ IDEA使用的默认JDK,这样我就不必重新加载项目了每次我导入一个新项目?

How do I change the default JDK that IntelliJ IDEA uses, so that I don't have to reload my project every time I import a new project?

推荐答案

此设置在默认项目结构...对话框中更改。导航到文件 - >其他设置 - >默认项目结构...。

This setting is changed in the "Default Project Structure..." dialog. Navigate to "File" -> "Other Settings" -> "Default Project Structure...".

接下来,将项目语言级别设置修改为所需的语言级别。

Next, modify the "Project language level" setting to your desired language level.

IntelliJ IDEA 12在模板项目结构......而不是默认项目结构......

IntelliJ IDEA 12 had this setting in "Template Project Structure..." instead of "Default Project Structure..."

这篇关于如何更改IntelliJ IDEA默认JDK?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆