错误提示错误提示信息为:
error:java: java.lang.exceptionininitializererror com.sun.tools.javac.code.typetags
如果使用 maven 错误信息是一样的。
[info] ------------------------------------------------------------------------[info] build failure[info] ------------------------------------------------------------------------[info] total time: 2.449 s[info] finished at: 2020-02-26t08:34:45-05:00[info] ------------------------------------------------------------------------[error] failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project core-java-annotations: fatal error compiling: java.lang.exceptionininitializererror: com.sun.tools.javac.code.typetags -> [help 1][error][error] to see the full stack trace of the errors, re-run maven with the -e switch.[error] re-run maven using the -x switch to enable full debug logging.[error][error] for more information about the errors and possible solutions, please read the following articles:[error] [help 1] http://cwiki.apache.org/confluence/display/maven/mojoexecutionexception
请问这是什么原因呢?
这个可能原因是你编译器的环境使用过高。但是你的依赖
<dependency> <groupid>org.projectlombok</groupid> <artifactid>lombok</artifactid> <version>1.6.12</version> <scope>provided</scope> </dependency>
过低导致的。
可以解决的办法是将你的编译 jdk 降到 1.8。
或者将 org.projectlombok 升级到最新的版本。
例如我们在 intellij 中,使用 1.8 编译代码,就没有错误。
以上就是java编译错误信息提示java.lang.exceptionininitializer如何解决的详细内容。