报错信息如下:

(各种配置在最后面)

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>

在Ubuntu中,用mvn打包hadoop源代码时报错,正在解决中!!!的更多相关文章

  1. 关于pycharm中安装第三方库时报错的解决办法(一)

    记录自己的生活!   一.事发背景 在pycharm中直接安装第三方库时因为版本问题总是无法安装成功,事情不大,但是很重要.   二.经过 最开始我自己电脑上安装了Python3.6和Python2. ...

  2. hadoop安装时报错 /usr/local/hadoop-2.6.0-stable/hadoop-2.6.0-src/hadoop-hdfs-project/hadoop-hdfs/target/findbugsXml.xml does not exist

    安装时报错:Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.7:run (site) on project ...

  3. 解决首次在eclipse中使用maven构建hadoop等项目时报Missing artifact sun.jdk:tools:jar:1.5.0的问题

    问题原因: eclipse中的maven插件默认没有引用环境变量,所以找不到jdk的路径,也就找不到tool.jar. 解决办法: 步骤如下: 1.关闭eclips 2.在eclipse的解压目录中与 ...

  4. 将MyEclipse中的项目导入到Eclipse中报错的解决放法

    1.导入项目后,会报红色感叹号, 将项目右键,点击红色框.

  5. Springboot+mybatis中整合过程访问Mysql数据库时报错

    报错原因如下:com.mysql.cj.core.exceptions.InvalidConnectionAttributeException: The server time zone.. 产生这个 ...

  6. 在Android Studio中打开Android Device Monitor时报错的解决方法

    在Android Studio中打开Android Device Monitor时报以下错误时(Android-SDK\tools\lib\monitor-x86_64\configuration\1 ...

  7. ionic中generate page后module.ts报错的解决办法

    此问题出现在Ionic官方将版本从2.2升级到Ionic3以上之后, 在项目中generate page时,自动创建的module.ts就报错,如下: 解决办法如下: 1)将IonicModule替换 ...

  8. kettle添加hadoop cluster时报错Caused by: java.lang.IllegalArgumentException: Does not contain a valid host:port authority: hadoop:password@node56:9000

    完整报错是: Caused by: java.lang.IllegalArgumentException: Does not contain a valid host:port authority: ...

  9. Qt Creator中增加新的ui文件时报错

    原因分析:moc_开头的文件编译过程中没有又一次生成导致. 解决的方法:删除编译产生的build目录.又一次编译就可以. 错误类型截图例如以下: 这个问题的解决.使得能够在不论什么时候都能够在proj ...

随机推荐

  1. 洛谷 P2014 选课

    题目描述 在大学里每个学生,为了达到一定的学分,必须从很多课程里选择一些课程来学习,在课程里有些课程必须在某些课程之前学习,如高等数学总是在其它课程之前学习.现在有N门功课,每门课有个学分,每门课有一 ...

  2. 浅谈iOS学习之路

    转眼学习iOS已经快两年的时间了,这个路上有挫折也有喜悦,一步步走过来发现这个过程是我这一辈子的财富,我以前的老大总是对我说,年轻就是最大的资本(本人91年),现在才算是慢慢的体会到,反观自己走过的这 ...

  3. codeforce Gym 100685E Epic Fail of a Genie(MaximumProduction 贪心)

    题意:给出一堆元素,求一个子集,使子集的乘积最大,如有多个,应该使子集元素个数尽量小. 题解:贪心,如果有大于1的正数,那么是一定要选的,注意负数也可能凑出大于1的正数,那么将绝对值大于1的负数两两配 ...

  4. WINDOWS-API:关于线程CreateThread,_beginthead(_beginthreadex),AfxBeginThread

    [转]windows多线程编程CreateThread,_beginthead(_beginthreadex)和AfxBeginThread的区别 在Windows的多线程编程中,创建线程的函数主要有 ...

  5. C#数组简介

    一.数组的定义 数组:是一种包含若干个变量的数据结构,这些变量可以通过索引进行访问. 数组的元素:数组中的变量就称为数组的元素. 元素类型:数组中的元素具有相同的数据类型,该数据类型就称为数组的元素类 ...

  6. c++ 调用php

    int _System(const char * cmd, std::string& strRet) { FILE * fp; char * p = NULL; ; if ((fp = _po ...

  7. [LUOGU] P4251 [SCOI2015]小凸玩矩阵

    行列看成点,格子看成边,二分一个边权,删去大于它的边,新图上的最大流>k则答案可以更优,小于k则调整左边界. #include<algorithm> #include<iost ...

  8. Linux - which xxx - 查找执行的命令所在的路径

    Linux 下,我们常使用 cd ,grep,vi 等命令,有时候我们要查到这些命令所在的位置,如何做呢? Linux 下有2个命令可完成该功能:which ,whereis which 用来查看当 ...

  9. fread()创建文件和file_exists()文件缓存问题

    ①fread('','w')调用当文件不存在时创建文件,其中参数使用了fread('',"w")导致无法创建文件,修改单引号之后操作正常. ②项目当中新建日志文件,需要判断日志文件 ...

  10. python入门:简单模拟登陆时UTF-8转换成GBK编码

    #!/usr/bin/env python # -*- coding:utf-8 -*- """ 给变量x赋值为字符串‘请输入用户名:’ 变量x_unicode的赋值等于 ...