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

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

问题描述

我使用 IntelliJ IDEA 作为我的开发环境,使用 Maven 进行依赖管理.我经常在 IDEA 之外构建我的项目结构(目录、poms 等),然后使用 Import project from external model 将项目导入 IDEA.这很好用,除了在我的 poms 中我指定 maven-compiler-plugin 应该使用 JDK 1.6,当我导入时,IDEA 通知我 Language Level ChangedLanguage level更改将在项目重新加载时生效,然后提示重新加载项目.这很烦人,因为我总是使用相同的 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 "Structure for New Projects" dialog. Navigate to "File" -> "New Projects Settings" -> "Structure for New Projects..."

接下来,修改Project SDK"和项目语言级别"视情况而定.

Next, modify the "Project SDK" and "Project Language Level" as appropriate.

以前版本的 IntelliJ IDEA 在文件"中有此设置;->其他设置"->默认项目结构...".

Previous versions of IntelliJ IDEA had this setting in "File" -> "Other Settings" -> "Default Project Structure...".

IntelliJ IDEA 12 在模板项目结构..."中有这个设置;而不是默认项目结构..."

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

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

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