OPENJDK 源码编译

Posted 注销了

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了OPENJDK 源码编译相关的知识,希望对你有一定的参考价值。

我的环境:

Ubuntu 16.04 LTS 

openjdk-7u75-src-b13-18_dec_2014.zip

apache-ant-1.8.0-bin.zip

环境变量:

export LANG=C
export ALT_BOOTDIR=/home/wangx/warehouse/jdk1.7.0_80
export ALLOW_DOWNLOADS=true
export HOTSPOT_BUILD_JOBS=6
export ALT_PARALLEL_COMPILE_JOBS=6
export SKIP_COMPARE_IMAGES=true
export USE_PRECOMPILED_HEADER=true
export BUILD_LANGTOOLS=true
#export BUILD_JAXP=false
#export BUILD_JAXWS=false
#export BUILD_CORBA=false
export BUILD_HOTSPOT=true
export BUILD_JDK=true
#export SKIP_DEBUG_BUILD=false
#export SKIP_FASTDEBUG_BUILD=true
#export DEBUG_NAME=debug
BUILD_DEPLOY=false
BUILD_INSTALL=false
export ALT_OUTPUTDIR=/home/wangx/warehouse/openjdk7src
unset JAVA_HOME
unset CLASSPATH

 执行make进行编译之后,报错说不支持该OS,日志输出如下:

make -f /home/wangx/warehouse/openjdk/hotspot/make/linux/Makefile checks
make[5]: Entering directory ‘/home/wangx/warehouse/openjdk7src/hotspot/outputdir‘
INFO: ENABLE_FULL_DEBUG_SYMBOLS=1
INFO: /usr/bin/objcopy cmd found so will create .debuginfo files.
INFO: STRIP_POLICY=min_strip
INFO: ZIP_DEBUGINFO_FILES=1
>&2 echo "*** This OS is not supported:" `uname -a`; exit 1;
*** This OS is not supported: Linux wangx-VirtualBox 4.4.0-21-generic #37-Ubuntu SMP Mon Apr 18 18:33:37 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
/home/wangx/warehouse/openjdk/hotspot/make/linux/Makefile:240: recipe for target ‘check_os_version‘ failed
make[5]: *** [check_os_version] Error 1
make[5]: Leaving directory ‘/home/wangx/warehouse/openjdk7src/hotspot/outputdir‘
/home/wangx/warehouse/openjdk/hotspot/make/linux/Makefile:261: recipe for target ‘linux_amd64_compiler2/debug‘ failed
make[4]: *** [linux_amd64_compiler2/debug] Error 2
make[4]: Leaving directory ‘/home/wangx/warehouse/openjdk7src/hotspot/outputdir‘
Makefile:191: recipe for target ‘generic_build2‘ failed
make[3]: *** [generic_build2] Error 2
make[3]: Leaving directory ‘/home/wangx/warehouse/openjdk/hotspot/make‘
Makefile:151: recipe for target ‘product‘ failed
make[2]: *** [product] Error 2

 可以看到错误是从/home/wangx/warehouse/openjdk/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%

以上是关于OPENJDK 源码编译的主要内容,如果未能解决你的问题,请参考以下文章

openjdk7之编译和debug

mac big sur openjdk8 源码编译

mac big sur openjdk8 源码编译

写 Java 这么久了,你编译过 JDK 源码吗

源码编译OpenJDK 15

修改,编译,GDB调试openjdk8源码(docker环境下)