报错信息如下:
(各种配置在最后面)
hadoop@administrator-virtual-machine:~/Downloads/tar/hadoop-3.0.0-alpha1-src$ mvn clean package -Pdist,native -DskipTests -Dtar
---------------------------------------------------
constituent[0]: file:/usr/share/maven/lib/plexus-cipher.jar
constituent[1]: file:/usr/share/maven/lib/wagon-http-shaded.jar
constituent[2]: file:/usr/share/maven/lib/plexus-interpolation.jar
constituent[3]: file:/usr/share/maven/lib/slf4j-simple.jar
constituent[4]: file:/usr/share/maven/lib/maven-plugin-api-3.x.jar
constituent[5]: file:/usr/share/maven/lib/slf4j-api.jar
constituent[6]: file:/usr/share/maven/lib/maven-settings-builder-3.x.jar
constituent[7]: file:/usr/share/maven/lib/maven-model-builder-3.x.jar
constituent[8]: file:/usr/share/maven/lib/maven-builder-support-3.x.jar
constituent[9]: file:/usr/share/maven/lib/guice.jar
constituent[10]: file:/usr/share/maven/lib/eclipse-aether-api.jar
constituent[11]: file:/usr/share/maven/lib/commons-lang.jar
constituent[12]: file:/usr/share/maven/lib/wagon-provider-api.jar
constituent[13]: file:/usr/share/maven/lib/commons-lang3.jar
constituent[14]: file:/usr/share/maven/lib/maven-embedder-3.x.jar
constituent[15]: file:/usr/share/maven/lib/javax.inject.jar
constituent[16]: file:/usr/share/maven/lib/aopalliance.jar
constituent[17]: file:/usr/share/maven/lib/wagon-http-shared.jar
constituent[18]: file:/usr/share/maven/lib/commons-cli.jar
constituent[19]: file:/usr/share/maven/lib/eclipse-aether-transport-wagon.jar
constituent[20]: file:/usr/share/maven/lib/maven-model-3.x.jar
constituent[21]: file:/usr/share/maven/lib/maven-settings-3.x.jar
constituent[22]: file:/usr/share/maven/lib/eclipse-aether-impl.jar
constituent[23]: file:/usr/share/maven/lib/maven-repository-metadata-3.x.jar
constituent[24]: file:/usr/share/maven/lib/eclipse-aether-spi.jar
constituent[25]: file:/usr/share/maven/lib/wagon-file.jar
constituent[26]: file:/usr/share/maven/lib/plexus-component-annotations.jar
constituent[27]: file:/usr/share/maven/lib/plexus-sec-dispatcher.jar
constituent[28]: file:/usr/share/maven/lib/sisu-inject.jar
constituent[29]: file:/usr/share/maven/lib/guava.jar
constituent[30]: file:/usr/share/maven/lib/maven-artifact-3.x.jar
constituent[31]: file:/usr/share/maven/lib/maven-aether-provider-3.x.jar
constituent[32]: file:/usr/share/maven/lib/eclipse-aether-connector-basic.jar
constituent[33]: file:/usr/share/maven/lib/plexus-utils.jar
constituent[34]: file:/usr/share/maven/lib/maven-compat-3.x.jar
constituent[35]: file:/usr/share/maven/lib/commons-io.jar
constituent[36]: file:/usr/share/maven/lib/maven-core-3.x.jar
constituent[37]: file:/usr/share/maven/lib/cdi-api.jar
constituent[38]: file:/usr/share/maven/lib/jsoup.jar
constituent[39]: file:/usr/share/maven/lib/sisu-plexus.jar
constituent[40]: file:/usr/share/maven/lib/eclipse-aether-util.jar
constituent[41]: file:/usr/share/maven/conf/logging/
---------------------------------------------------
Exception in thread "main" com.google.common.util.concurrent.ExecutionError: java.lang.NoClassDefFoundError: Could not initialize class com.google.inject.internal.cglib.core.$ReflectUtils
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2203)
at com.google.common.cache.LocalCache.get(LocalCache.java:3951)
at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3955)
at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4870)
at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:4876)
at com.google.inject.internal.FailableCache.get(FailableCache.java:48)
at com.google.inject.internal.ConstructorInjectorStore.get(ConstructorInjectorStore.java:50)
at com.google.inject.internal.ConstructorBindingImpl.initialize(ConstructorBindingImpl.java:137)
at com.google.inject.internal.InjectorImpl.initializeBinding(InjectorImpl.java:533)
at com.google.inject.internal.AbstractBindingProcessor$Processor$1.run(AbstractBindingProcessor.java:160)
at com.google.inject.internal.ProcessedBindingData.initializeBindings(ProcessedBindingData.java:44)
at com.google.inject.internal.InternalInjectorCreator.initializeStatically(InternalInjectorCreator.java:123)
at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:107)
at com.google.inject.Guice.createInjector(Guice.java:99)
at com.google.inject.Guice.createInjector(Guice.java:73)
at com.google.inject.Guice.createInjector(Guice.java:62)
at org.codehaus.plexus.DefaultPlexusContainer.addPlexusInjector(DefaultPlexusContainer.java:481)
at org.codehaus.plexus.DefaultPlexusContainer.<init>(DefaultPlexusContainer.java:206)
at org.apache.maven.cli.MavenCli.container(MavenCli.java:545)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:281)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:543)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.google.inject.internal.cglib.core.$ReflectUtils
at com.google.inject.internal.cglib.reflect.$FastClass$Generator.getProtectionDomain(FastClass.java:73)
at com.google.inject.internal.cglib.core.$AbstractClassGenerator.create(AbstractClassGenerator.java:206)
at com.google.inject.internal.cglib.reflect.$FastClass$Generator.create(FastClass.java:65)
at com.google.inject.internal.BytecodeGen.newFastClass(BytecodeGen.java:204)
at com.google.inject.internal.DefaultConstructionProxyFactory.create(DefaultConstructionProxyFactory.java:55)
at com.google.inject.internal.ProxyFactory.create(ProxyFactory.java:159)
at com.google.inject.internal.ConstructorInjectorStore.createConstructor(ConstructorInjectorStore.java:90)
at com.google.inject.internal.ConstructorInjectorStore.access$000(ConstructorInjectorStore.java:29)
at com.google.inject.internal.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:37)
at com.google.inject.internal.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:33)
at com.google.inject.internal.FailableCache$1.load(FailableCache.java:37)
at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3540)
at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2321)
at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2284)
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2199)
... 28 more
hadoop@administrator-virtual-machine:~/Downloads/tar/hadoop-3.0.0-alpha1-src$
一、java版本:
hadoop@administrator-virtual-machine:~$ java -version
java version "9-ea"
Java(TM) SE Runtime Environment (build 9-ea+152)
Java HotSpot(TM) Server VM (build 9-ea+152, mixed mode)
1 /usr/lib/jvm/java-8-openjdk-i386/jre/bin/java 1081 manual mode
* 2 /usr/lib/jvm/java-9-oracle/bin/java 1091 manual mode
二、Mvn版本
hadoop@administrator-virtual-machine:~$ mvn --version
Apache Maven 3.3.9
Maven home: /usr/share/maven
Java version: 9-ea, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-9-oracle
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.4.0-59-generic", arch: "i386", family: "unix"
三、.bashrc配置
hadoop@administrator-virtual-machine:~$ vim ~/.bashrc
export JAVA_HOME=/usr/lib/jvm/java-9-oracle
export JRE_HOME=$JAVA_HOME/jre
export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib
export HADOOP_PREFIX=/usr/local/hadoop
export HADOOP_HOME=/usr/local/hadoop
export HADOOP_COMMON_LIB_NATIVE_DIR=$HADOOP_HOME/lib/native
export M2_HOME=/usr/share/maven
export PATH=$PATH:$JAVA_HOME/bin:$M2_HOME/bin
四、/etc/environment配置
hadoop@administrator-virtual-machine:~$ sudo gedit /etc/environment
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
export JAVA_HOME=/usr/lib/jvm/java-9-oracle
export JRE_Home=$JAVA_HOME/jre
export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
五、/etc/profile配置
hadoop@administrator-virtual-machine:~$ sudo gedit /etc/profile
export JAVA_HOME=/usr/lib/jvm/java-9-oracle
export JRE_HOME=$JAVA_HOME/jre
export CLASSPATH=$CLASSPATH:.:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
export M2_HOME=/usr/share/maven
export M2=$M2_HOME/bin
export MAVEN_OPTS="-Xms256m -Xmx512m"
export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$M2_HOME/bin:$PATH
六、~/.m2/settings.xml配置
hadoop@administrator-virtual-machine:~$ sudo gedit ~/.m2/settings.xml
<localRepository>${user.home}/.m2/repository</localRepository>
<profile>
<id>jdk-1.9</id>
<activation>
<jdk>1.9</jdk>
</activation>
<repositories>
<repository>
<id>jdk19</id>
<name>Repository for JDK 1.9 builds</name>
<url>http://www.myhost.com/maven/jdk19</url>
<layout>default</layout>
<snapshotPolicy>always</snapshotPolicy>
</repository>
</repositories>
</profile>