Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using OpenJDK 9 EA with IntelliJ

Right now I'm trying to setup IntelliJ to play around with OpenJDK 9 which I downloaded and installed from here. I got the 64 bit Windows version. I added JDK 9 by going to Project Structure and adding the directory C:\Program Files\Java\jdk-9 as a new SDK. Everything looks great and normal until I try to actually run the program, then this happens.

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)

Has anyone else ran across this issue and found a way to use JDK 9 with IntelliJ?

like image 418
arjabbar Avatar asked Oct 30 '22 06:10

arjabbar


1 Answers

Maybe you have to try an older version of jdk. I have the same problem with you and I select an older version of jdk in IntelliJ. But I still have problem installing Eclipse with java 9-ea. this is my post:With java 9 ea, Eclipse fails to install and show error "An error has occurred, see the log file null"

like image 104
Andy Liu Avatar answered Nov 15 '22 05:11

Andy Liu