英文:
Update existing Spring Boot project from java 1.8 to java 11
问题
从存储库中提取了一个完全功能的Spring Boot应用程序代码,与Java 1.8一起运行良好。升级到Java 11后出现了错误,例如某些包可从多个模块访问:
The package javax.xml.parsers is accessible from more than one module: <unnamed>, java.xml
The package org.xml.sax is accessible from more than one module: <unnamed>, java.xml
尝试通过以下链接提供的方法来解决此问题,但未能解决:
- https://stackoverflow.com/questions/51094274/eclipse-cant-find-xml-related-classes-after-switching-build-path-to-jdk-10/53824670#53824670
- https://www.eclipse.org/eclipse/news/4.8/jdt.php#Java9
英文:
Materialised fully functional Spring Boot application code from repository and working fine with java 1.8. While upgrading to Java 11 got errors like some packages is accessible from more than one module
1.The package javax.xml.parsers is accessible from more than one module: <unnamed>, java.xml
2.The package org.xml.sax is accessible from more than one module: <unnamed>, java.xml
Tried to resolve the issue by restrict dependency using methods provided in the below links but not helped.
Archiva dependency integrated to Spring Boot as rootParent
答案1
得分: 0
原因:xml.apis
和 java.xml
之间存在冲突,这是由于Java中的模块化概念引起的。
解决方案:在Maven的pom文件中排除xml.apis
依赖项。
英文:
Reason : Conflict between xml.apis
and java.xml
.due to the modularity concept in java
Solution : Excluded xml.apis
dependency in maven pom file.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论