问题整理[已解决] - Debian10 下编译 OpenJDK-8 源码 - 'check_os_version' failed

ERROR:××× recipe for target ‘check_os_version’ failed ×××

分析:./hotspot/make/linux/Makefile:226-240

checks: check_os_version check_j2se_version

# We do not want people accidentally building on old systems (e.g. Linux 2.2.x,
# Solaris 2.5.1, 2.6).
# Disable this check by setting DISABLE_HOTSPOT_OS_VERSION_CHECK=ok.

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))

check_os_version:
ifeq ($(DISABLE_HOTSPOT_OS_VERSION_CHECK)$(EMPTY_IF_NOT_SUPPORTED),)
    $(QUIETLY) >&2 echo "*** This OS is not supported:" `uname -a`; exit 1;
endif

可以看到支持的 Linux 内核版本包括2.4% 2.5% 2.6% 3%,这是为了阻止源码在老版本上被编译,但是在新内核版本4%也不能编译

解决办法:
方法一: 添加对应的内核版本SUPPORTED_OS_VERSION = 2.4% 2.5% 2.6% 3% 4%
方法二: 在make时添加参数 DISABLE_HOTSPOT_OS_VERSION_CHECK=ok

你可能感兴趣的:(java,linux,错误集,jdk,问题,jdk8,linux,错误集)