【已解决】编译报错Error:Internal error: (java.lang.IllegalStateException)

一、问题出现背景:

项目环境:Maven + IDEA + JDK1.8 + SpringBoot2.1.8

Error:Internal error: (java.lang.IllegalStateException) Duplicate key org.jetbrains.jps.model.module.impl.JpsModuleImpl@34b7ac2f
java.lang.IllegalStateException: Duplicate key org.jetbrains.jps.model.module.impl.JpsModuleImpl@34b7ac2f
	at java.util.stream.Collectors.lambda$throwingMerger$0(Collectors.java:133)
	at java.util.HashMap.merge(HashMap.java:1254)
	at java.util.stream.Collectors.lambda$toMap$58(Collectors.java:1320)
	at java.util.stream.ReduceOps$3ReducingSink.accept(ReduceOps.java:169)
	at java.util.Iterator.forEachRemaining(Iterator.java:116)
	at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
	at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
	at org.jetbrains.jps.maven.model.impl.MavenAnnotationProcessorTargetType.createLoader(MavenAnnotationProcessorTargetType.java:50)
	at org.jetbrains.jps.incremental.storage.BuildTargetTypeState.load(BuildTargetTypeState.java:66)
	at org.jetbrains.jps.incremental.storage.BuildTargetTypeState.(BuildTargetTypeState.java:55)
	at org.jetbrains.jps.incremental.storage.BuildTargetsState.getTypeState(BuildTargetsState.java:114)
	at org.jetbrains.jps.incremental.storage.BuildTargetsState.getAverageBuildTime(BuildTargetsState.java:108)
	at org.jetbrains.jps.incremental.messages.BuildProgress.(BuildProgress.java:70)
	at org.jetbrains.jps.incremental.IncProjectBuilder.runBuild(IncProjectBuilder.java:364)
	at org.jetbrains.jps.incremental.IncProjectBuilder.build(IncProjectBuilder.java:178)
	at org.jetbrains.jps.cmdline.BuildRunner.runBuild(BuildRunner.java:138)
	at org.jetbrains.jps.cmdline.BuildSession.runBuild(BuildSession.java:302)
	at org.jetbrains.jps.cmdline.BuildSession.run(BuildSession.java:135)
	at org.jetbrains.jps.cmdline.BuildMain$MyMessageHandler.lambda$channelRead0$0(BuildMain.java:229)
	at org.jetbrains.jps.service.impl.SharedThreadPoolImpl.lambda$executeOnPooledThread$0(SharedThreadPoolImpl.java:42)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

 

二、可能原因及尝试过程:

1、未知原因,重启电脑看看,没用

重启IDEA还是编译报错,也没有使用java8的stream也没有出过问题

2、使用命令启动项目mvn spring-boot:run是可以的

项目启动没问题,那就说明是编辑器IDEA的问题(挂了...)

3、在文章Intellij IDEA启动报错Internal error中看到删除配置文件,可行

重命名用户目录IntelliJIDEA的配置文件C:\Users\chameleons\.IntelliJIdea2018.3后(删除也行),重新启动IDEA有如下弹出框(同重新安装后配置)

【已解决】编译报错Error:Internal error: (java.lang.IllegalStateException)_第1张图片

三、最终解决:

重新安装IDEA即可解决,就是需要重新配置:一般设置如文字大小、JDK配置、Maven配置、Git配置、插件重新安装,其余的在用到时再修改IDEA配置

备注:

本文主要是借助博客环境,同大家讨论异常问题解决的办法,欢迎大家评论,谢谢!

你可能感兴趣的:(报错问题)