Search code examples
javaeclipsejava-11java-modulespring-boot-maven-plugin

Update existing Spring Boot project from java 1.8 to java 11


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.

  1. Eclipse can't find XML related classes after switching build path to JDK 10

  2. https://www.eclipse.org/eclipse/news/4.8/jdt.php#Java9

Setting Eclipse JRE

Setting Java Version in POM

Setting Sping Version

Archiva dependency integrated to Spring Boot as rootParent

Error While upgrading to java 11

Build path of migrated project


Solution

  • Reason : Conflict between xml.apis and java.xml.due to the modularity concept in java

    Solution : Excluded xml.apis dependency in maven pom file.