当前位置:   article > 正文

intelliJ IDEA 2019 JDK配置错误导致:java.lang.NoClassDefFoundError_error:internal error: (java.lang.noclassdeffounder

error:internal error: (java.lang.noclassdeffounderror) could not initialize

项目场景:

首次构建Maven 项目,出现Build错误


问题描述

intelliJ IDEA 2019 运行错误 :java.lang.NoClassDefFoundError

`Error:Internal error: (java.lang.NoClassDefFoundError) Could not initialize class com.intellij.util.io.FileChannelUtil
java.lang.NoClassDefFoundError: Could not initialize class com.intellij.util.io.FileChannelUtil

Error:Internal error: (java.lang.IllegalAccessError) class com.intellij.util.io.FileChannelUtil (in unnamed module @0x327b636c) cannot access class sun.nio.ch.FileChannelImpl (in module java.base) because module java.base does not export sun.nio.ch to unnamed module @0x327b636c
java.lang.IllegalAccessError: class com.intellij.util.io.FileChannelUtil (in unnamed module @0x327b636c) cannot access class sun.nio.ch.FileChannelImpl (in module java.base) because module java.base does not export sun.nio.ch to unnamed module @0x327b636c
	at com.intellij.util.io.FileChannelUtil.setupUnInterruptibleHandle(FileChannelUtil.java:26)
	at com.intellij.util.io.FileChannelUtil.<clinit>(FileChannelUtil.java:18)
	at com.intellij.util.io.ReadWriteDirectBufferWrapper$FileContext$1.execute(ReadWriteDirectBufferWrapper.java:50)
	at com.intellij.util.io.ReadWriteDirectBufferWrapper$FileContext$1.execute(ReadWriteDirectBufferWrapper.java:42)
	at com.intellij.openapi.util.io.FileUtilRt.doIOOperation(FileUtilRt.java:945)
	at com.intellij.util.io.ReadWriteDirectBufferWrapper$FileContext.<init>(ReadWriteDirectBufferWrapper.java:42)
	at com.intellij.util.io.ReadWriteDirectBufferWrapper.create(ReadWriteDirectBufferWrapper.java:27)
	at com.intellij.util.io.DirectBufferWrapper.getBuffer(DirectBufferWrapper.java:24)
	at com.intellij.util.io.ReadWriteDirectBufferWrapper.getBuffer(ReadWriteDirectBufferWrapper.java:16)
	at com.intellij.util.io.PagedFileStorage$StorageLock.createValue(PagedFileStorage.java:631)
	at com.intellij.util.io.PagedFileStorage$StorageLock.get(PagedFileStorage.java:558)
	at com.intellij.util.io.PagedFileStorage$StorageLock.access$500(PagedFileStorage.java:466)
	at com.intellij.util.io.PagedFileStorage.getBufferWrapper(PagedFileStorage.java:407)
	at com.intellij.util.io.PagedFileStorage.getReadOnlyBuffer(PagedFileStorage.java:375)
	at com.intellij.util.io.PagedFileStorage.getInt(PagedFileStorage.java:155)
	at com.intellij.util.io.ResizeableMappedFile.getInt(ResizeableMappedFile.java:217)
	at com.intellij.util.io.PersistentEnumeratorBase.<init>(PersistentEnumeratorBase.java:212)
	at com.intellij.util.io.PersistentBTreeEnumerator.<init>(PersistentBTreeEnumerator.java:73)
	at com.intellij.util.io.PersistentEnumeratorDelegate.<init>(PersistentEnumeratorDelegate.java:47)
	at com.intellij.util.io.PersistentHashMap.<init>(PersistentHashMap.java:149)
	at com.intellij.util.io.PersistentHashMap.<init>(PersistentHashMap.java:138)
	at com.intellij.util.io.PersistentHashMap.<init>(PersistentHashMap.java:129)
	at com.intellij.util.io.PersistentHashMap.<init>(PersistentHashMap.java:121)
	at com.intellij.util.io.PersistentHashMap.<init>(PersistentHashMap.java:114)
	at org.jetbrains.jps.incremental.storage.AbstractStateStorage.createMap(AbstractStateStorage.java:124)
	at org.jetbrains.jps.incremental.storage.AbstractStateStorage.<init>(AbstractStateStorage.java:27)
	at org.jetbrains.jps.incremental.storage.FileTimestampStorage.<init>(FileTimestampStorage.java:27)
	at org.jetbrains.jps.incremental.storage.ProjectStamps.<init>(ProjectStamps.java:39)
	at org.jetbrains.jps.incremental.storage.ProjectTimestamps.<init>(ProjectTimestamps.java:19)
	at org.jetbrains.jps.cmdline.BuildRunner.load(BuildRunner.java:92)
	at org.jetbrains.jps.cmdline.BuildSession.runBuild(BuildSession.java:274)
	at org.jetbrains.jps.cmdline.BuildSession.run(BuildSession.java:130)
	at org.jetbrains.jps.cmdline.BuildMain$MyMessageHandler.lambda$channelRead0$0(BuildMain.java:232)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:833)

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42

原因分析:

提示:这里填写问题的分析:

intelliJ IDEA 2019 JDK 版本不匹配,自己电脑上原来安装的是JDK17,intelliJ IDEA 2019不支持。


解决方案:

安装JDK11,重新配置 JDK11
点击File->Projectstructure->ProjectSetting->Project->Project SDK
在这里插入图片描述
在这里插入图片描述
重新运行
在这里插入图片描述

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/知新_RL/article/detail/395569
推荐阅读
相关标签
  

闽ICP备14008679号