1.问题
Error:java: System Java Compiler was not found in classpath:
java.lang.ClassNotFoundException: com.sun.tools.javac.api.JavacTool
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at org.jetbrains.jps.builders.impl.java.JavacCompilerTool.createCompiler(JavacCompilerTool.java:74)
at org.jetbrains.jps.javac.JavacMain.compile(JavacMain.java:52)
at org.jetbrains.jps.incremental.java.JavaBuilder.compileJava(JavaBuilder.java:486)
at org.jetbrains.jps.incremental.java.JavaBuilder.compile(JavaBuilder.java:338)
at org.jetbrains.jps.incremental.java.JavaBuilder.doBuild(JavaBuilder.java:263)
at org.jetbrains.jps.incremental.java.JavaBuilder.build(JavaBuilder.java:216)
at org.jetbrains.jps.incremental.IncProjectBuilder.runModuleLevelBuilders(IncProjectBuilder.java:1328)
at org.jetbrains.jps.incremental.IncProjectBuilder.runBuildersForChunk(IncProjectBuilder.java:1006)
at org.jetbrains.jps.incremental.IncProjectBuilder.buildTargetsChunk(IncProjectBuilder.java:1073)
at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunkIfAffected(IncProjectBuilder.java:967)
at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunks(IncProjectBuilder.java:796)
at org.jetbrains.jps.incremental.IncProjectBuilder.runBuild(IncProjectBuilder.java:378)
at org.jetbrains.jps.incremental.IncProjectBuilder.build(IncProjectBuilder.java:178)
at org.jetbrains.jps.cmdline.BuildRunner.runBuild(BuildRunner.java:140)
at org.jetbrains.jps.cmdline.BuildSession.runBuild(BuildSession.java:297)
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.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)
2.解决方法
-
打开settings
-
选中Java Compiler
-
更改Use compiler为eclipse
-
原理尚不清楚