现在我正在尝试设置 IntelliJ 来使用我从这里下载并安装的 OpenJDK 9 。我得到了 64 位 Windows 版本。我通过转到项目结构并将目录C:\Program Files\Java\jdk-9添加为新的 SDK 添加了 JDK 9。在我尝试实际运行程序之前,一切看起来都很好而且很正常,然后就会发生这种情况。
Error:Internal error: (java.lang.NoClassDefFoundError) Could not initialize class java.lang.management.ManagementFactory$PlatformMBeanFinder
java.lang.NoClassDefFoundError: Could not initialize class java.lang.management.ManagementFactory$PlatformMBeanFinder
at java.lang.management.ManagementFactory.getPlatformMXBeans(ManagementFactory.java:684)
at java.lang.management.ManagementFactory.getMemoryPoolMXBeans(ManagementFactory.java:392)
at com.intellij.openapi.util.LowMemoryWatcher.<clinit>(LowMemoryWatcher.java:84)
at com.intellij.util.io.PersistentHashMap.<init>(PersistentHashMap.java:118)
at com.intellij.util.io.PersistentHashMap.<init>(PersistentHashMap.java:126)
at org.jetbrains.jps.incremental.storage.AbstractStateStorage.createMap(AbstractStateStorage.java:136)
at org.jetbrains.jps.incremental.storage.AbstractStateStorage.<init>(AbstractStateStorage.java:41)
at org.jetbrains.jps.incremental.storage.TimestampStorage.<init>(TimestampStorage.java:36)
at org.jetbrains.jps.incremental.storage.ProjectTimestamps.<init>(ProjectTimestamps.java:36)
at org.jetbrains.jps.cmdline.BuildRunner.load(BuildRunner.java:90)
at org.jetbrains.jps.cmdline.BuildSession.runBuild(BuildSession.java:266)
at org.jetbrains.jps.cmdline.BuildSession.run(BuildSession.java:125)
at org.jetbrains.jps.cmdline.BuildMain$MyMessageHandler$1.run(BuildMain.java:232)
at org.jetbrains.jps.service.impl.SharedThreadPoolImpl$1.run(SharedThreadPoolImpl.java:44)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:514)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1158)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:632)
at java.lang.Thread.run(Thread.java:804)
有没有其他人遇到过这个问题并找到了一种将 JDK 9 与 IntelliJ 一起使用的方法?