文章目錄
- 問題
- 解決方法
- 參考
問題
最近Java工程找不到javax.xml.bind.annotation包,進行了解決。
解決方法
參考 stackoverflow: package javax.xml.bind.annotation does not exist error
javax.xml.bind
這個庫從Java 11
版本就被移除了,缺失了這個包返回錯誤,解決辦法是進行主動添加,將以下部分添加到pom.xml
中,由maven進行編譯,問題解決。
<dependencies><dependency><groupId>javax.xml.bind</groupId><artifactId>jaxb-api</artifactId><version>2.3.1</version></dependency><dependency><groupId>com.sun.xml.bind</groupId><artifactId>jaxb-impl</artifactId><version>2.3.1</version></dependency></dependencies>
參考
stackoverflow: package javax.xml.bind.annotation does not exist error