Spring源码框架构建失败 kotlin-compiler.jar (系统找不到指定的文件。) 问题解决方法


问题描述

在Spring源码构建输出的时候报错,错误信息如下:java.io.FileNotFoundException: C:\Users\ZPJX\AppData\Local\JetBrains\IntelliJIdea2022.3\kotlin-dist-for-ide\1.6.21\lib\kotlin-compiler.jar (系统找不到指定的文件。)

Kotlin: [Internal Error] java.io.FileNotFoundException: C:\Users\ZPJX\AppData\Local\JetBrains\IntelliJIdea2022.3\kotlin-dist-for-ide\1.6.21\lib\kotlin-compiler.jar (系统找不到指定的文件。)
	at java.base/java.io.FileInputStream.open0(Native Method)
	at java.base/java.io.FileInputStream.open(FileInputStream.java:216)
	at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
	at org.jetbrains.kotlin.preloading.ClassPreloadingUtils.loadAllClassesFromJars(ClassPreloadingUtils.java:128)
	at org.jetbrains.kotlin.preloading.ClassPreloadingUtils.preloadClasses(ClassPreloadingUtils.java:49)
	at org.jetbrains.kotlin.preloading.ClassPreloadingUtils.preloadClasses(ClassPreloadingUtils.java:71)
	at org.jetbrains.kotlin.compilerRunner.CompilerRunnerUtil.getOrCreateClassLoader(CompilerRunnerUtil.kt:64)
	at org.jetbrains.kotlin.compilerRunner.CompilerRunnerUtil.withCompilerClassloader(CompilerRunnerUtil.kt:122)
	at org.jetbrains.kotlin.compilerRunner.CompilerRunnerUtil.invokeExecMethod(CompilerRunnerUtil.kt:92)
	at org.jetbrains.kotlin.compilerRunner.JpsKotlinCompilerRunner.fallbackCompileStrategy(JpsKotlinCompilerRunner.kt:302)
	at org.jetbrains.kotlin.compilerRunner.JpsKotlinCompilerRunner.access$fallbackCompileStrategy(JpsKotlinCompilerRunner.kt:37)
	at org.jetbrains.kotlin.compilerRunner.JpsKotlinCompilerRunner$compileWithDaemonOrFallback$2.invoke(JpsKotlinCompilerRunner.kt:183)
	at org.jetbrains.kotlin.compilerRunner.JpsKotlinCompilerRunner$compileWithDaemonOrFallback$2.invoke(JpsKotlinCompilerRunner.kt:181)
	at org.jetbrains.kotlin.compilerRunner.JpsKotlinCompilerRunner.withDaemonOrFallback(JpsKotlinCompilerRunner.kt:232)
	at org.jetbrains.kotlin.compilerRunner.JpsKotlinCompilerRunner.compileWithDaemonOrFallback(JpsKotlinCompilerRunner.kt:181)
	at org.jetbrains.kotlin.compilerRunner.JpsKotlinCompilerRunner.runCompiler(JpsKotlinCompilerRunner.kt:189)
	at org.jetbrains.kotlin.compilerRunner.JpsKotlinCompilerRunner.runK2JvmCompiler(JpsKotlinCompilerRunner.kt:140)
	at org.jetbrains.kotlin.jps.targets.KotlinJvmModuleBuildTarget.compileModuleChunk(KotlinJvmModuleBuildTarget.kt:140)
	at org.jetbrains.kotlin.jps.build.KotlinBuilder.doCompileModuleChunk(KotlinBuilder.kt:578)
	at org.jetbrains.kotlin.jps.build.KotlinBuilder.doBuild(KotlinBuilder.kt:414)
	at org.jetbrains.kotlin.jps.build.KotlinBuilder.build(KotlinBuilder.kt:299)
	at org.jetbrains.jps.incremental.IncProjectBuilder.runModuleLevelBuilders(IncProjectBuilder.java:1523)
	at org.jetbrains.jps.incremental.IncProjectBuilder.runBuildersForChunk(IncProjectBuilder.java:1153)
	at org.jetbrains.jps.incremental.IncProjectBuilder.buildTargetsChunk(IncProjectBuilder.java:1303)
	at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunkIfAffected(IncProjectBuilder.java:1118)
	at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunks(IncProjectBuilder.java:889)
	at org.jetbrains.jps.incremental.IncProjectBuilder.runBuild(IncProjectBuilder.java:471)
	at org.jetbrains.jps.incremental.IncProjectBuilder.build(IncProjectBuilder.java:197)
	at org.jetbrains.jps.cmdline.BuildRunner.runBuild(BuildRunner.java:150)
	at org.jetbrains.jps.cmdline.BuildSession.runBuild(BuildSession.java:371)
	at org.jetbrains.jps.cmdline.BuildSession.run(BuildSession.java:193)
	at org.jetbrains.jps.cmdline.BuildMain$MyMessageHandler.lambda$channelRead0$0(BuildMain.java:211)
	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)

原因分析:

在重新加载Gradle的时候都会有这个弹窗跳出来
在这里插入图片描述
Spring源码框架构建失败 kotlin-compiler.jar (系统找不到指定的文件。) 问题解决方法_第1张图片
仔细观察发现Kotlin编译器版本不对,应该是在加载Gradle的时候被改写了


解决方案:

Spring源码框架构建失败 kotlin-compiler.jar (系统找不到指定的文件。) 问题解决方法_第2张图片
修改Kotlin编译器的版本然后重新运行,问题就解决了
Spring源码框架构建失败 kotlin-compiler.jar (系统找不到指定的文件。) 问题解决方法_第3张图片

你可能感兴趣的:(问题报错解决,kotlin,spring)