问题:
今天下完IDEA2019,试运行代码时报错,
错误:Internal error: (java.lang.IllegalAccessError) class com.intellij.util.io.FileChannelUtil (in unnamed module @0x60611244) cannot access class sun.nio.ch.FileChannelImpl (in module java.base) because module java.base does not export sun.nio.ch to unnamed module @0x60611244
java.lang.IllegalAccessError: class com.intellij.util.io.FileChannelUtil (in unnamed module @0x60611244) cannot access class sun.nio.ch.FileChannelImpl (in module java.base) because module java.base does not export sun.nio.ch to unnamed module @0x60611244
解决方法:
网上看了下帖子,发现可能是JDK版本号太高,看了下自己电脑是JDK17的,19不支持JDK17,卸载JDK,安装了一个JDK8的,最后运行无报错
JDK8安装包
链接: https://pan.baidu.com/s/1vsw-bKuCuC2fvVWnfJ4XFA?pwd=v4f2 提取码: v4f2