IntelliJ IDEA无法启动:无法加载JDK类:com.sun.jdi.Field

编程入门 行业动态 更新时间:2024-10-12 05:54:37
本文介绍了IntelliJ IDEA无法启动:无法加载JDK类:com.sun.jdi.Field的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

当我尝试启动IntelliJ时,会弹出一个对话框

When I try to start IntelliJ I get a popup saying

Cannot load a JDK class: com.sun.jdi.Field Please ensure you run the IDE on JDK rather than JRE.

这真的很奇怪,因为我已经将JAVA_HOME和PATH变量指向了Java 11 JDK.

It's really strange because I've pointed the JAVA_HOME and PATH variable to the Java 11 JDK.

推荐答案

如果使用其他版本覆盖默认的JetBrains Runtime,则会出现此问题,IDE将该运行时的位置保存在 CONFIG \idea64.exe.jdk文件,然后此运行时变得无效(已删除或损坏)或与新的IDE版本不兼容.

This issue occurs if you override the default JetBrains Runtime with some other version, IDE saves the location of this runtime under CONFIG\idea64.exe.jdk file and then this runtime becomes invalid (removed or corrupted) or incompatible with the new IDE version.

解决方案是删除idea64.exe.jdk/idea.exe.jdk文件,以便IDE使用默认的捆绑JetBrains Runtime(文件名可能因所使用的产品而异,因此一般指南是删除 IDE中的文件配置目录 ).

The solution is to delete idea64.exe.jdk/idea.exe.jdk file so that IDE is using the default bundled JetBrains Runtime (the file name could be different depending on the product you are using, so the general guide is to delete *.jdk files in the IDE config directory).

以下是Windows上大多数用户应删除的文件:

Here is the file that should be deleted for most of the users on Windows:

c:\Users\<user>\AppData\Roaming\JetBrains\IntelliJIdea2020.1\idea64.exe.jdk

当该文件指向Java 8时,由于IntelliJ IDEA不再在Java 8上运行,而期望使用Java 11,因此会发生问题. Java 11已经捆绑在一起,但是此文件将其覆盖,因此出现了问题.

The issue occurs when this file points to Java 8 as IntelliJ IDEA no longer runs on Java 8 and is expecting Java 11 instead. Java 11 is already bundled, but this file overrides it, hence the problem.

也请检查此文档,以了解其他替代IDE运行时的方法并确保所有这些都不生效:

Please also check this document for the other possible ways to override IDE runtime and make sure none of these is in effect:

IDEA_JDK_64环境变量也可能会覆盖默认的运行时,您需要取消设置.

IDEA_JDK_64 environment variable may also override the default runtime, you need to unset it.

另一个可能的问题是jbr子目录中的捆绑运行时已损坏.通过在IDE_HOME\jbr\bin中运行java -version进行验证.重新安装IDE应该会有所帮助.

Another possible issue is that the bundled runtime in jbr subdirectory becomes corrupted. Verify it by running java -version inside IDE_HOME\jbr\bin. Reinstalling IDE should help.

另请参阅在IntelliJ IDEA论坛中的相关讨论.

问题是正在YouTrack中进行调查.

更多推荐

IntelliJ IDEA无法启动:无法加载JDK类:com.sun.jdi.Field

本文发布于:2023-11-25 05:55:09,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1628586.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:无法启动   加载   IDEA   IntelliJ   Field

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!