Java編譯錯誤信息提示java.lang.ExceptionInInitializer解決
錯誤提示
錯誤提示信息為:
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
請問這是什么原因呢?

這個可能原因是你編譯器的環(huán)境使用過高。但是你的依賴
<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的詳細內(nèi)容,更多關(guān)于Java編譯錯誤信息提示的資料請關(guān)注腳本之家其它相關(guān)文章!
相關(guān)文章
InputStreamReader和BufferedReader用法及實例講解
這篇文章主要介紹了InputStreamReader和BufferedReader用法及實例講解的相關(guān)資料,需要的朋友可以參考下2015-12-12
WebSocket獲取httpSession空指針異常的解決辦法
這篇文章主要介紹了在使用WebSocket實現(xiàn)p2p或一對多聊天功能時,如何獲取HttpSession來獲取用戶信息,本文結(jié)合實例代碼給大家介紹的非常詳細,感興趣的朋友一起看看吧2025-01-01
Java設(shè)計模式之責任鏈模式(Chain of Responsibility模式)介紹
這篇文章主要介紹了Java設(shè)計模式之責任鏈模式(Chain of Responsibility模式)介紹,本文講解了如何使用責任鏈模式,并給出了4種使用實例,需要的朋友可以參考下2015-03-03
SpringBoot返回前端Long類型字段丟失精度問題及解決方案
Java服務(wù)端返回Long整型數(shù)據(jù)給前端,JS會自動轉(zhuǎn)換為Number類型,本文主要介紹了SpringBoot返回前端Long類型字段丟失精度問題及解決方案,感興趣的可以了解一下2024-03-03
Java操作XML轉(zhuǎn)JSON數(shù)據(jù)格式詳細代碼實例
在Java中我們可以使用一些現(xiàn)成的庫來實現(xiàn)XML到JSON的轉(zhuǎn)換,下面這篇文章主要給大家介紹了關(guān)于Java操作XML轉(zhuǎn)JSON數(shù)據(jù)格式的相關(guān)資料,文中通過代碼介紹的非常詳細,需要的朋友可以參考下2024-04-04
spring整合atomikos實現(xiàn)分布式事務(wù)的方法示例
本文整合了一個spring和atomikos的demo,并且通過案例演示說明atomikos的作用,具有一定的參考價值,感興趣的小伙伴們可以參考一下2019-05-05

