ubuntu20上编译openjdk8

5 篇文章 0 订阅

记录下在ubuntu20下编译openjdk8时遇到的问题。
内核信息:

Linux yy-virtual-machine 5.4.0-53-generic #59-Ubuntu SMP Wed Oct 21 09:38:44 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

相关执行脚本

bash ./configure  --with-target-bits=64 --with-boot-jdk=/your/boot/jdk/path --with-debug-level=slowdebug
make all

个人boot jdk使用的是jdk7。

1、问题1

*** This OS is not supported: Linux yy-virtual-machine 5.4.0-53-generic #59-Ubuntu SMP Wed Oct 21 09:38:44 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
make[5]: *** [/home/yy/openjdk8/hotspot/make/linux/Makefile:234:check_os_version] 错误 1
make[4]: *** [/home/yy/openjdk8/hotspot/make/linux/Makefile:255:linux_amd64_compiler2/fastdebug] 错误 2
make[3]: *** [Makefile:217:generic_build2] 错误 2
make[2]: *** [Makefile:167:debug] 错误 2

解决方法:
进入 openjdk8/hotspot/make/linux/ 编辑 Makefile 文件。
SUPPORTED_OS_VERSION = 2.4% 2.5% 2.6% 3% 改为
SUPPORTED_OS_VERSION = 2.4% 2.5% 2.6% 3% 4%

2、问题2

make[5]: *** [/home/yy/openjdk8/hotspot/make/linux/makefiles/top.make:91:ad_stuff] 错误 2
make[4]: *** [/home/yy/openjdk8/hotspot/make/linux/Makefile:289:debug] 错误 2
make[3]: *** [Makefile:217:generic_build2] 错误 2
make[2]: *** [Makefile:167:debug] 错误 2
make[1]: *** [HotspotWrapper.gmk:45:/home/yy/openjdk8/build/linux-x86_64-normal-server-slowdebug/hotspot/_hotspot.timestamp] 错误 2
make: *** [/home/yy/openjdk8//make/Main.gmk:109:hotspot-only] 错误 2

解决方法:
修改hotspot/make/linux/makefiles/adjust-mflags.sh 第67行增加一个I.(注意是大写的i, 而不是竖线)
在这里插入图片描述

3、错误3

/hotspot/src/share/vm/code/dependencies.hpp:169:59: error: left operand of shift expression ‘(-1 << 1)’ is negative [-fpermissive]

这里warning和error的日志都会输出。只用处理error级别的就行。
解决办法:
适用低级别的gcc和g++ (个人使用的是4.9)
可以在/usr/bin 下直接删除gcc和g++然后再添加4.9版本的软链。
需要注意的是修改gcc版本后需要重新执行 configure ,不然还是会报错。

几分钟后就能看到成功的信息了
在这里插入图片描述
jdk 版本信息:
在这里插入图片描述

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值