我试图通过此链接来构建自己的JDK:
http://hg.openjdk.java.net/jdk8/jdk8/raw-file/tip/README-builds.html#introduction
回顾一下步骤如下:
在最后一步,它显示如下错误:
*** This OS is not supported: Linux compitition2 4.15.0-32-generic #35-Ubuntu SMP Fri Aug 10 17:58:07 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
/home/jon/Downloads/OpenJDK/hotspot/make/linux/Makefile:234: recipe for target 'check_os_version' failed
make[5]: *** [check_os_version] Error 1
/home/jon/Downloads/OpenJDK/hotspot/make/linux/Makefile:255: recipe for target 'linux_amd64_compiler2/debug' failed
make[4]: *** [linux_amd64_compiler2/debug] Error 2
Makefile:216: recipe for target 'generic_build2' failed
make[3]: *** [generic_build2] Error 2
make[2]: *** [product] Error 2
Makefile:167: recipe for target 'product' failed
make[1]: *** [/home/jon/Downloads/OpenJDK/build/linux-x86_64-normal-server-release/hotspot/_hotspot.timestamp] Error 2
HotspotWrapper.gmk:44: recipe for target '/home/jon/Downloads/OpenJDK/build/linux-x86_64-normal-server-release/hotspot/_hotspot.timestamp' failed
/home/jon/Downloads/OpenJDK//make/Main.gmk:108: recipe for target 'hotspot-only' failed
make: *** [hotspot-only] Error 2
我的实验机是64位的Ubuntu 18.04。
cat / etc / *-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.1 LTS"
NAME="Ubuntu"
VERSION="18.04.1 LTS (Bionic Beaver)"
uanme -a
Linux compitition2 4.15.0-32-generic #35-Ubuntu SMP Fri Aug 10 17:58:07 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
答案 0 :(得分:2)
根据Makefile,不支持内核4.X。支票将uname -r
与版本模式2.4% 2.5% 2.6% 3%
进行比较:
SUPPORTED_OS_VERSION = 2.4% 2.5% 2.6% 3%
OS_VERSION := $(shell uname -r)
EMPTY_IF_NOT_SUPPORTED = $(filter $(SUPPORTED_OS_VERSION),$(OS_VERSION))
您可以尝试使用DISABLE_HOTSPOT_OS_VERSION_CHECK
选项进行构建,看看会发生什么,但是降级到Kernel 3.X更安全。如果您要构建旧的JDK 8,则可以启动具有某些旧发行版的虚拟机,例如Fedora 9 with gcc 4.3.0 as per Supported Build Platforms。