Error:java: System Java Compiler was not found in classpath:
程序员文章站
2022-04-05 10:29:06
...
今天把项目的jdk版本从1.8换成1.7,在build项目时出现一下错误:
Error:java: System Java Compiler was not found in classpath:
java.lang.ClassNotFoundException: com.sun.tools.javac.api.JavacTool
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.jetbrains.jps.builders.impl.java.JavacCompilerTool.createCompiler(JavacCompilerTool.java:74)
at org.jetbrains.jps.javac.JavacMain.compile(JavacMain.java:51)
at org.jetbrains.jps.javac.ExternalJavacProcess.compile(ExternalJavacProcess.java:190)
at org.jetbrains.jps.javac.ExternalJavacProcess.access$300(ExternalJavacProcess.java:32)
at org.jetbrains.jps.javac.ExternalJavacProcess$CompilationRequestsHandler$1.run(ExternalJavacProcess.java:255)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
主要原因是在没有完全切换jdk版本:
推荐阅读
-
启动hadoop,报错Error JAVA_HOME is not set and could not be found
-
IDEA 错误Error:java: Compilation failed: internal java compiler error
-
Android:java.io.IOException: Cannot run program "/system/xbin/su": error=13, Permission denied
-
【Hadoop】记录一个问题:Error:java: Compilation failed: internal java compiler error,改了版本还是不行
-
Zookeeper安装 Zookeeper启动 报错Error: JAVA_HOME is not set and java could not be found in PATH
-
Error:java: System Java Compiler was not found in classpath: