问题
I tried to follow this link to build my own JDK:
http://hg.openjdk.java.net/jdk8/jdk8/raw-file/tip/README-builds.html#introduction
To recap the steps are as:
- hg clone http://hg.openjdk.java.net/jdk8/jdk8 YourOpenJDK
- cd YourOpenJDK
- bash ./get_source.sh
- bash ./configure
- make all
In the last step, it showed error like:
*** 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
my experimental machine is Ubuntu 18.04, 64bit.
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
回答1:
As per Makefile Kernel 4.X is not supported. The check compares uname -r
to with version patterns 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))
You can try building with DISABLE_HOTSPOT_OS_VERSION_CHECK
option and see what happens but downgrading to Kernel 3.X is safer. If you want to build old JDK 8 maybe spin up a virtual machine with some older distribution e.g. Fedora 9 with gcc 4.3.0 as per Supported Build Platforms.
来源:https://stackoverflow.com/questions/54315646/failed-to-build-open-jdk-8-from-source-ubuntu-18-04-64bit