IntelliJ IDEA无法启动:无法加载JDK类:com.sun.jdi.Field [英] IntelliJ IDEA doesn't start: Cannot load a JDK class: com.sun.jdi.Field

查看:760
本文介绍了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_HOMEPATH变量指向了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将该运行时的位置保存在

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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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