怎么在idea中全局设置为默认jdk版本为11?
时间: 2023-06-02 19:05:07 浏览: 2132
你可以按照以下步骤在IDEA中全局设置默认的JDK版本为11:
1. 打开IDEA并进入File->Project Structure菜单。
2. 在左侧菜单栏中选择SDKs。
3. 点击加号以添加JDK11,如果你还没有安装,可以先下载JDK11并安装。
4. 在右侧窗格中选择JDK11并点击OK进行保存。
5. 进入File->Default Settings,再次选择Project Structure设置为JDK11即可。
希望对你有所帮助。
相关问题
idea tomcat 设置jdk版本
### 如何在IntelliJ IDEA中设置Tomcat服务器使用指定的JDK版本
#### 启用必要的插件
为了确保能够顺利配置Tomcat,在IntelliJ IDEA 中需要启用 `Tomcat and TomEE Integration` 插件[^1]。
#### JDK 的安装与配置
确认目标JDK已经正确安装于本地计算机。接着打开 IntelliJ IDEA,通过如下路径进入全局库管理界面:
- 对应菜单栏中的 `File | Project Structure...`
在此窗口内切换到 `Project` 选项卡来设定项目的 SDK 版本;对于模块级别的调整,则需前往 `Modules` -> 所选模块名 -> `Dependencies` 来指派特定的编译器和运行时环境。
#### 配置 Application Server 使用指定 JDK
当准备就绪之后,按照下面的操作指引关联Tomcat实例并为其分配合适的Java解释程序:
- 进入 `Run/Debug Configurations` 页面;
- 展开左侧列表里的 `Server` 节点,定位至 `Use classpath of module:` 字段旁的选择框;
- 此处应当选取希望该应用服务器所依赖的那个项目模块——这一步骤间接决定了将会采用哪个预设好的SDK作为执行上下文的一部分[^2]。
另外一种方式是在定义具体的应用部署描述符之前先做一次更广泛的改动,即修改IDE默认提供的启动脚本模板里关于JAVA_HOME变量指向的内容。不过这种方式相对复杂一些而且可能影响其他类型的Web容器行为模式[^3]。
```bash
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_XXX.jdk/Contents/Home
```
idea 怎么全局配置JDK
在 IntelliJ IDEA 中全局配置 JDK 的步骤如下:
1. 打开 IntelliJ IDEA,点击 File -> Project Structure
2. 在左侧菜单中选择 SDKs
3. 点击右上角的加号,选择 JDK
4. 在弹出的窗口中选择 JDK 安装路径,点击 OK
5. 在左侧菜单中选择 Project,在右侧的 Project SDK 中选择刚刚添加的 JDK
6. 点击 Apply -> OK 完成配置
这样配置后,所有新建的项目都会默认使用该 JDK。如果需要在某个项目中使用其他 JDK,可以在该项目的设置中进行更改。
阅读全文
相关推荐













