# 更改 IDE 的启动 Java 运行时

> For the complete documentation index, see [llms.txt](https://www.jetbrains.com.cn/help/idea/llms.txt).

作为 Java 应用程序，IntelliJ IDEA 需要 Java 运行环境 ( JRE )。 默认情况下，IntelliJ IDEA 使用 [JetBrains Runtime](https://github.com/JetBrains/JetBrainsRuntime)（ [OpenJDK](https://github.com/openjdk/jdk) 的一个分支），该运行时包含在 IDE 中。 JetBrains Runtime 修复了各种已知的 OpenJDK 和 Oracle JDK 错误，并提供了更好的性能和稳定性。 但是，在某些情况下，您可能需要使用其他的 Java 运行时或特定版本的 JetBrains Runtime。

> **Warning:**
> 更改启动 Java 运行时可能会导致意外问题。 除非 [JetBrains 支持](https://www.jetbrains.com.cn/support/) 明确要求，否则请不要更改。

> **Note:**
> 用于 IntelliJ IDEA 的运行时环境与您的应用程序所使用的运行时环境不同。 为您的每个项目定义一个 [SDK](sdk.html)，其中包括必要的开发和运行环境。

Procedure: 切换用于运行 IntelliJ IDEA 的 Java 运行时

1. 在主菜单中，转到  `帮助 | 查找操作…​​`  或按 `Ctrl+Shift+A` (Windows), `⌘ ⇧ A` (macOS), `⌘ ⇧ A` (IntelliJ IDEA Classic (macOS)), `⌘ ⇧ P` (macOS System Shortcuts), `Ctrl+Shift+A` (XWin), `Ctrl+Shift+A` (GNOME), `Ctrl+Shift+A` (KDE), `Escape, X` (Emacs), `Ctrl+Shift+P` (Sublime Text), `⌘ ⇧ P` (Sublime Text (macOS)), `Ctrl+Shift+A` (Visual Studio), `⌘ ⇧ A` (Visual Studio (macOS)), `Ctrl+I` (NetBeans), `Ctrl+Shift+A` (Eclipse), `⌘ 3` (Eclipse (macOS))。

2. 找到并选择   选择 IDE 的启动 Java 运行时…  操作。

3. 请选择新的期望运行时并点击   OK  。

如果需要，您可以更改 IntelliJ IDEA 将下载所选运行时的位置。

4. 请等待 IntelliJ IDEA 使用新的运行时重新启动。

当您第一次打开   为 IDE 选择 Boot Runtime  对话框时，加载 JetBrains Runtime 构建列表可能需要一些时间。

![为 IDE 选择 Boot Runtime](https://resources.jetbrains.com.cn/help/img/idea/2026.3/choose-boot-java-runtime-for-ide.png)

要使用您计算机上的不同 Java 运行时，请在   添加自定义运行环境…   下选择   高级   在   新建   字段中。 IntelliJ IDEA 列出了其能够检测到的所有 JDK 和 JRE。 选择一个或点击   添加 JDK  来指定所需 Java home 目录的位置。

要重置回 IDE 最初使用的默认运行时，请点击   使用默认运行环境  。

> **Note:**
> 如果为 IntelliJ IDEA 使用非默认的 Java 运行时，它将不会与 IDE 一起更新，并且可能与新版本不兼容。 在更新 IntelliJ IDEA 时，重置回默认运行时以获取 JetBrains Runtime 的最新兼容版本。

所选运行时的路径存储在  `idea.jdk`  或  `idea64.jdk`  文件中，位于 IntelliJ IDEA [配置目录](directories-used-by-the-ide-to-store-settings-caches-plugins-and-logs.html#config-directory)。 如果所选运行时有问题，您可以删除此文件以恢复到默认运行时。

您还可以通过添加  `IDEA_JDK`  环境变量，并指定所需 JDK 主目录的路径，来覆盖 IntelliJ IDEA 使用的运行时。

