使用破碎的Oracle-JDK8类构建maven项目

时间:2018-02-15 18:21:08

标签: java maven

当我使用GraphChi-java基准来分析网络图时,我遇到了与mvn相关的问题。

Maven版本和Java版本:

Apache Maven 3.5.2 (138edd61fd100ec658bfa2d307c43b76940a5d7d; 2017-10-18T03:58:13-04:00)
Maven home: /usr/local/maven
Java version: 1.8.0_161, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-8-oracle/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.15.0-041500-lowlatency", arch: "amd64", family: "unix"

构建信息为link

mvn assembly:assembly -DdescriptorId=jar-with-dependencies

但是,我收到有关

的错误
    1. error: error while loading CharSequence, class file '/usr/lib/jvm/java-8-oracle/jre/lib/rt.jar(java/lang/CharSequence.class)' is broken
    1. error: error while loading ConcurrentMap, class file '/usr/lib/jvm/java-8-oracle/jre/lib/rt.jar(java/util/concurrent/ConcurrentMap.class)' is broken
    1. error: error while loading AnnotatedElement, class file '/usr/lib/jvm/java-8-oracle/jre/lib/rt.jar(java/lang/reflect/AnnotatedElement.class)' is broken

这些错误很奇怪,因为我认为java-8-oracle应该没有问题。为什么有些class被打破了?如何解决?

wxf@wxf:/home/wxf/javaPrj/graphChi/graphchi-java$ mvn assembly:assembly -DdescriptorId=jar-with-dependencies
[INFO] Scanning for projects...
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for org.graphchi:graphchi-java_2.11:jar:0.2.2
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.apache.commons:commons-math:jar -> version 2.0 vs 2.1 @ line 81, column 17
[WARNING] 
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] 
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING] 
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] Building graphchi-java_2.11 0.2.2
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] >>> maven-assembly-plugin:2.2.2:assembly (default-cli) > package @ graphchi-java_2.11 >>>
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ graphchi-java_2.11 ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/wxf/javaPrj/graphChi/graphchi-java/src/main/resources
[INFO] 
[INFO] --- maven-scala-plugin:2.15.2:compile (default) @ graphchi-java_2.11 ---
[INFO] Checking for multiple versions of scala
[INFO] includes = [**/*.java,**/*.scala,]
[INFO] excludes = []
[INFO] /home/wxf/javaPrj/graphChi/graphchi-java/src/main/java:-1: info: compiling
[INFO] /home/wxf/javaPrj/graphChi/graphchi-java/src/main/scala:-1: info: compiling
[INFO] Compiling 121 source files to /home/wxf/javaPrj/graphChi/graphchi-java/target/classes at 1518718593215
[ERROR] error: error while loading CharSequence, class file '/usr/lib/jvm/java-8-oracle/jre/lib/rt.jar(java/lang/CharSequence.class)' is broken
[INFO] (bad constant pool tag 18 at byte 10)
[ERROR] error: error while loading ConcurrentMap, class file '/usr/lib/jvm/java-8-oracle/jre/lib/rt.jar(java/util/concurrent/ConcurrentMap.class)' is broken
[INFO] (bad constant pool tag 18 at byte 61)
[ERROR] error: error while loading AnnotatedElement, class file '/usr/lib/jvm/java-8-oracle/jre/lib/rt.jar(java/lang/reflect/AnnotatedElement.class)' is broken
[INFO] (bad constant pool tag 18 at byte 76)
[ERROR] three errors found
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.874 s
[INFO] Finished at: 2018-02-15T13:16:38-05:00
[INFO] Final Memory: 26M/1928M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.scala-tools:maven-scala-plugin:2.15.2:compile (default) on project graphchi-java_2.11: wrap: org.apache.commons.exec.ExecuteException: Process exited with an error: 1(Exit value: 1) -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

0 个答案:

没有答案