我已经决定是时候从Java 8升级到Java 11了。因此,我阅读了一些教程并进行了更改。
我想升级到
openjdk version "11.0.4" 2019-07-16
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.4+11)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.4+11, mixed mode)
我正在使用
openjdk version "1.8.0_222"
OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_222-b10)
OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.222-b10, mixed mode)
我也有
Apache Maven 3.6.0 (97c98ec64a1fdfee7767ce5ffb20918da4f719f3; 2018-10-24T20:41:47+02:00)
Maven home: /usr/lib/maven/3.6.0
Java version: 11.0.4, vendor: AdoptOpenJDK, runtime: /usr/lib/jvm/java-11.0.4.11-adoptopenjdk
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.15.0-55-generic", arch: "amd64", family: "unix"
一切看起来都很正常,但是由于error_prone_core
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ core ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 324 source files to /srv/core/target/test-classes
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.errorprone.bugpatterns.FutureReturnValueIgnored (file:/var/cache/maven/com/google/errorprone/error_prone_core/2.3.3/error_prone_core-2.3.3.jar) to field com.sun.tools.javac.code.Type$StructuralTypeMapping$4.this$0
WARNING: Please consider reporting this to the maintainers of com.google.errorprone.bugpatterns.FutureReturnValueIgnored
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
我尝试通过添加以下内容
来修复警告<arg>-J--illegal-access=debug</arg>
<arg>-J--add-opens=java.base/java.lang=ALL-UNNAMED</arg>
<arg>-J--add-opens=java.base/java.lang.reflect=ALL-UNNAMED</arg>
<arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED</arg>
但是什么也没发生...所以我想我可能需要添加<fork>true</fork>
...所以我确保为maven配置了正确的JAVA_HOME
并尝试了fork ...但是现在某些模块因此警告而使构建失败...
[INFO] -------------------------------------------------------------
[WARNING] COMPILATION WARNING :
[INFO] -------------------------------------------------------------
[WARNING] [path] bad path element "/home/fprochazka/.m2/repository/org/glassfish/jaxb/jaxb-runtime/2.3.2/jakarta.xml.bind-api-2.3.2.jar": no such file or directory
[WARNING] [path] bad path element "/home/fprochazka/.m2/repository/org/glassfish/jaxb/jaxb-runtime/2.3.2/txw2-2.3.2.jar": no such file or directory
[WARNING] [path] bad path element "/home/fprochazka/.m2/repository/org/glassfish/jaxb/jaxb-runtime/2.3.2/istack-commons-runtime-3.0.8.jar": no such file or directory
[WARNING] [path] bad path element "/home/fprochazka/.m2/repository/org/glassfish/jaxb/jaxb-runtime/2.3.2/stax-ex-1.8.1.jar": no such file or directory
[WARNING] [path] bad path element "/home/fprochazka/.m2/repository/org/glassfish/jaxb/jaxb-runtime/2.3.2/FastInfoset-1.2.16.jar": no such file or directory
[WARNING] [path] bad path element "/home/fprochazka/.m2/repository/org/glassfish/jaxb/jaxb-runtime/2.3.2/jakarta.activation-api-1.2.1.jar": no such file or directory
[INFO] 6 warnings
我使用的是Spring Boot 2.2.0.M5 spring-boot-dependencies
,几乎没有其他版本定义。根据{{1}},由于休眠,mvn dependency:tree
被导入
jaxb-runtime
我尝试恢复到Java 8并首先解决那里的问题。这是完整的maven编译器配置...如果我添加[INFO] +- org.hibernate:hibernate-core:jar:5.4.4.Final:compile
[INFO] | +- org.jboss.logging:jboss-logging:jar:3.4.0.Final:compile
[INFO] | +- org.javassist:javassist:jar:3.25.0-GA:compile
[INFO] | +- net.bytebuddy:byte-buddy:jar:1.10.0:compile
[INFO] | +- antlr:antlr:jar:2.7.7:compile
[INFO] | +- org.jboss.spec.javax.transaction:jboss-transaction-api_1.2_spec:jar:1.1.1.Final:compile
[INFO] | +- org.jboss:jandex:jar:2.0.5.Final:compile
[INFO] | +- com.fasterxml:classmate:jar:1.5.0:compile
[INFO] | +- javax.activation:javax.activation-api:jar:1.2.0:compile
[INFO] | +- org.dom4j:dom4j:jar:2.1.1:compile
[INFO] | +- org.hibernate.common:hibernate-commons-annotations:jar:5.1.0.Final:compile
[INFO] | +- javax.xml.bind:jaxb-api:jar:2.3.1:compile
[INFO] | \- org.glassfish.jaxb:jaxb-runtime:jar:2.3.2:compile
[INFO] | +- org.glassfish.jaxb:txw2:jar:2.3.2:compile
[INFO] | +- com.sun.istack:istack-commons-runtime:jar:3.0.8:compile
[INFO] | +- org.jvnet.staxex:stax-ex:jar:1.8.1:compile
[INFO] | +- com.sun.xml.fastinfoset:FastInfoset:jar:1.2.16:compile
[INFO] | \- jakarta.activation:jakarta.activation-api:jar:1.2.1:compile
<fork>true</fork>
此外,如果我在本地启动我们应用程序的正确运行版本,则该行由Spring记录。它没有登录生产服务器,因为没有<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration combine.self="append">
<compilerId>javac-with-errorprone</compilerId>
<forceJavacCompilerUse>true</forceJavacCompilerUse>
<source>8</source>
<target>8</target>
<compilerArgs combine.self="override">
<arg>-Werror</arg>
<arg>-Xlint:all,-fallthrough,-processing,-serial,-classfile</arg>
<arg>-parameters</arg>
<arg>-XDcompilePolicy=simple</arg>
<arg>-XepDisableWarningsInGeneratedCode</arg>
<arg>-XepOpt:Immutable:KnownImmutable=javax.money.CurrencyUnit</arg>
<arg>-Xep:ConstantField:WARN</arg>
<arg>-Xep:ClassName:WARN</arg>
<arg>-Xep:DivZero:WARN</arg>
<arg>-Xep:EmptyIf:WARN</arg>
<arg>-Xep:IterablePathParameter:WARN</arg>
<arg>-Xep:LongLiteralLowerCaseSuffix:WARN</arg>
<arg>-Xep:AnnotationPosition:WARN</arg>
<arg>-Xep:EmptyTopLevelDeclaration:WARN</arg>
<arg>-Xep:EqualsBrokenForNull:WARN</arg>
<arg>-Xep:FunctionalInterfaceClash:WARN</arg>
<arg>-Xep:InvalidInlineTag:WARN</arg>
<arg>-Xep:InvalidParam:WARN</arg>
<arg>-Xep:MissingDefault:WARN</arg>
<arg>-Xep:NonCanonicalStaticMemberImport:WARN</arg>
<arg>-Xep:PrimitiveArrayPassedToVarargsMethod:WARN</arg>
<arg>-Xep:RedundantOverride:WARN</arg>
<arg>-Xep:RedundantThrows:WARN</arg>
<arg>-Xep:StaticQualifiedUsingExpression:WARN</arg>
<arg>-Xep:StringEquality:WARN</arg>
<arg>-Xep:UnusedException:WARN</arg>
<arg>-Xep:ConstantField:WARN</arg>
<arg>-Xep:MultiVariableDeclaration:WARN</arg>
<arg>-Xep:MultipleTopLevelClasses:WARN</arg>
<arg>-Xep:MultipleUnaryOperatorsInMethodCall:WARN</arg>
<arg>-Xep:PrivateConstructorForUtilityClass:WARN</arg>
<arg>-Xep:UngroupedOverloads:WARN</arg>
</compilerArgs>
<annotationProcessorPaths combine.self="append"/>
<showWarnings>true</showWarnings>
</configuration>
<dependencies>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-compiler-javac-errorprone</artifactId>
<version>2.8.5</version>
</dependency>
<dependency>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_core</artifactId>
<version>2.3.3</version>
</dependency>
</dependencies>
</plugin>
线程,该线程仅存在于存在devtools的本地计算机上。我相信这是有关的。
restartedMain
我的猜测是16:48:22.397 [restartedMain ] INFO o.s.boot.devtools.restart.ChangeableUrls: The Class-Path manifest attribute in /home/fprochazka/.m2/repository/org/glassfish/jaxb/jaxb-runtime/2.3.2/jaxb-runtime-2.3.2.jar referenced one or more files that do not exist: file:/home/fprochazka/.m2/repository/org/glassfish/jaxb/jaxb-runtime/2.3.2/jakarta.xml.bind-api-2.3.2.jar,file:/home/fprochazka/.m2/repository/org/glassfish/jaxb/jaxb-runtime/2.3.2/txw2-2.3.2.jar,file:/home/fprochazka/.m2/repository/org/glassfish/jaxb/jaxb-runtime/2.3.2/istack-commons-runtime-3.0.8.jar,file:/home/fprochazka/.m2/repository/org/glassfish/jaxb/jaxb-runtime/2.3.2/stax-ex-1.8.1.jar,file:/home/fprochazka/.m2/repository/org/glassfish/jaxb/jaxb-runtime/2.3.2/FastInfoset-1.2.16.jar,file:/home/fprochazka/.m2/repository/org/glassfish/jaxb/jaxb-runtime/2.3.2/jakarta.activation-api-1.2.1.jar
在某种程度上被破坏了,它引用了不存在的JAR,但是由于这些类可用,因此它仍然可以工作。
我不知道如何解决此错误或在何处报告此类错误。有任何想法吗?谢谢