现在我正在尝试设置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)
有没有其他人遇到过这个问题并找到了在IntelliJ中使用JDK 9的方法?