我正在尝试将一个Spring Boot应用程序从JDK 8升级到JDK 11,并进行了以下更改:
1. 在pom.xml中使用java.version。
当我运行
1. 在pom.xml中使用java.version。
<properties>
<java.version>11</java.version>
</properties>
2.添加已移除模块的依赖项:
<!--1.JAF(java.activation)-->
<dependency>
<groupId>com.sun.activation</groupId>
<artifactId>javax.activation</artifactId>
</dependency>
<!--2.JTA(java.transaction)-->
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
</dependency>
<!--3.JAXB(java.xml.bind)-->
<!--API-->
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>2.3.2</version>
</dependency>
<!--Runtime-->
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
</dependency>
<!--4.JAX-WS(java.xml.ws)-->
<!--API-->
<dependency>
<groupId>jakarta.xml.ws</groupId>
<artifactId>jakarta.xml.ws-api</artifactId>
<version>2.3.2</version>
</dependency>
<!--Runtime-->
<dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>jaxws-rt</artifactId>
<version>2.3.2</version>
</dependency>
<!--5.CommonsAnnotations(java.xml.ws.annotation)-->
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
</dependency>
3. 增加了以下插件:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<release>11</release>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.22.0</version>
</plugin>
当我运行
mvn clean package
命令时,出现了错误:compiler message file broken:key=compiler.misc.msg.bugarguments=11.0.4-redhat,{1},{2},{3},{4},{5},{6},{7}
java.lang.StackOverflowError
atjdk.compiler/com.sun.tools.javac.comp.Attr.attribTree(Attr.java:652)
atjdk.compiler/com.sun.tools.javac.comp.Attr.visitSelect(Attr.java:3573)
atjdk.compiler/com.sun.tools.javac.tree.JCTree$JCFieldAccess.accept(JCTree.java:2114)
atjdk.compiler/com.sun.tools.javac.comp.Attr.attribTree(Attr.java:655)
atjdk.compiler/com.sun.tools.javac.comp.Attr.visitApply(Attr.java:2006)
atjdk.compiler/com.sun.tools.javac.tree.JCTree$JCMethodInvocation.accept(JCTree.java:1634)
你对我做错了什么或者我需要做什么其他的事情有什么想法吗?提前致谢。