hadoop 源码编译出错?求大神解决!!!

问答 好好学习 ⋅ 于 2018-03-04 10:57:03 ⋅ 最后回复由 青牛 2018-03-04 16:26:36 ⋅ 4981 阅读

cd /usr/local/hadoop-2.7.3-src/ 执行后 再执行mvn clean package -Pdist,native -DskipTests -Dtar -Dbundle.snappy -Dsnappy.lib=/usr/local/lib 提示Unrecognized VM option 'MaxMetaspaceSize=512M'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit. 这是什么问题呢?

成为第一个点赞的人吧 :bowtie:
回复数量: 7
  • 青牛 海汼部落创始人,80后程序员一枚,曾就职于金山,喜欢倒腾技术做产品
    2018-03-04 11:31:06

    你把maven使用的虚拟机内存调大点就好了
    export MAVEN_OPTS=-Xmx2048m

  • 好好学习
    2018-03-04 13:07:07

    export MAVEN_OPTS="-Xmx2g -XX:MaxMetaspaceSize=512M -XX:ReservedCodeCacheSize=512m" 是把这句中的512换成2048?

  • 青牛 海汼部落创始人,80后程序员一枚,曾就职于金山,喜欢倒腾技术做产品
    2018-03-04 13:26:32

    @好好学习 你的这句不用换,或者直接用我那个就行

  • 好好学习
    2018-03-04 13:34:17

    真的管用,谢谢老师!!!

  • 好好学习
    2018-03-04 14:00:36

    老师,这个可以运行但编译失败Downloaded: https://repo.maven.apache.org/maven2/org/sonatype/aether/aether-api/1.7/aether-api-1.7.jar (73 KB at 0.5 KB/sec)
    [INFO] ------------------------------------------------------------------------
    [INFO] Reactor Summary:
    [INFO]
    [INFO] Apache Hadoop Main ................................. FAILURE [14:06 min]
    [INFO] Apache Hadoop Build Tools .......................... SKIPPED
    [INFO] Apache Hadoop Project POM .......................... SKIPPED
    [INFO] Apache Hadoop Annotations .......................... SKIPPED
    [INFO] Apache Hadoop Assemblies ........................... SKIPPED
    [INFO] Apache Hadoop Project Dist POM ..................... SKIPPED
    [INFO] Apache Hadoop Maven Plugins ........................ SKIPPED
    [INFO] Apache Hadoop MiniKDC .............................. SKIPPED
    [INFO] Apache Hadoop Auth ................................. SKIPPED
    [INFO] Apache Hadoop Auth Examples ........................ SKIPPED
    [INFO] Apache Hadoop Common ............................... SKIPPED
    [INFO] Apache Hadoop NFS .................................. SKIPPED
    [INFO] Apache Hadoop KMS .................................. SKIPPED
    [INFO] Apache Hadoop Common Project ....................... SKIPPED
    [INFO] Apache Hadoop HDFS ................................. SKIPPED
    [INFO] Apache Hadoop HttpFS ............................... SKIPPED
    [INFO] Apache Hadoop HDFS BookKeeper Journal .............. SKIPPED
    [INFO] Apache Hadoop HDFS-NFS ............................. SKIPPED
    [INFO] Apache Hadoop HDFS Project ......................... SKIPPED
    [INFO] hadoop-yarn ........................................ SKIPPED
    ................................................
    [INFO] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 18:20 min
    [INFO] Finished at: 2018-03-04T21:48:15+08:00
    [INFO] Final Memory: 44M/120M
    [INFO] ------------------------------------------------------------------------
    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.4:attach-descriptor (attach-descriptor) on project hadoop-main: Execution attach-descriptor of goal org.apache.maven.plugins:maven-site-plugin:3.4:attach-descriptor failed: Plugin org.apache.maven.plugins:maven-site-plugin:3.4 or one of its dependencies could not be resolved: Could not transfer artifact org.sonatype.aether:aether-spi:jar:1.7 from/to central (https://repo.maven.apache.org/maven2): Connect to repo.maven.apache.org:443 [repo.maven.apache.org/151.101.52.215] failed: 拒绝连接 -> [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/PluginResolutionException

    这是怎么回事呢?求解决

  • 好好学习
    2018-03-04 16:15:12

    总算编译成功了!我重新执行了命令

  • 青牛 海汼部落创始人,80后程序员一枚,曾就职于金山,喜欢倒腾技术做产品
    2018-03-04 16:26:36

    @好好学习 嗯hadoop checknetive,看看本地库没问题就行

暂无评论~~
  • 请注意单词拼写,以及中英文排版,参考此页
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`, 更多语法请见这里 Markdown 语法
  • 支持表情,可用Emoji的自动补全, 在输入的时候只需要 ":" 就可以自动提示了 :metal: :point_right: 表情列表 :star: :sparkles:
  • 上传图片, 支持拖拽和剪切板黏贴上传, 格式限制 - jpg, png, gif,教程
  • 发布框支持本地存储功能,会在内容变更时保存,「提交」按钮点击时清空
Ctrl+Enter