无法在 Intellij Idea 上运行 HelloWorld (java.lang.IllegalAccessError)

Mah*_*dir 6 java intellij-idea

我想在 Intellij Idea 上运行 HelloWorld 但失败了。在我的 macOS 中,Java 版本是“9-ea”。

Error:Internal error: (java.lang.IllegalAccessError) class com.intellij.util.io.FileChannelUtil (in unnamed module @0x6ecc4cd7) cannot access class sun.nio.ch.FileChannelImpl (in module java.base) because module java.base does not export sun.nio.ch to unnamed module @0x6ecc4cd7
java.lang.IllegalAccessError: class com.intellij.util.io.FileChannelUtil (in unnamed module @0x6ecc4cd7) cannot access class sun.nio.ch.FileChannelImpl (in module java.base) because module java.base does not export sun.nio.ch to unnamed module @0x6ecc4cd7
    at com.intellij.util.io.FileChannelUtil.setupUnInterruptibleHandle(FileChannelUtil.java:26)
    ......
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

Cra*_*der 5

请确保使用已发布的 JDK 版本,而不是ea更新到最新的 IntelliJ IDEA 版本。