##openjdk11源码编译环境
centos7内核3.10.0-1160.102.1.el7.x86_64
gcc version 7.3.1
g++ version 7.3.1
##引导JDK
cd /home/yym/code/
wget https://mirrors.huaweicloud.com/java/jdk/10.0.1+10/jdk-10.0.1_linux-x64_bin.tar.gz
##解压jdk10
tar -zxvf jdk-10.0.1_linux-x64_bin.tar.gz
##openjdk11源码下载
cd /home/yym/code/
yum install wget
wget https://codeload.github.com/openjdk/jdk11/zip/refs/heads/master
##解压openjdk11源码
yum install unzip
unzip jdk11-master.zip
##安装编译openjdk11源码需要的依赖包
yum install autoconf
yum install libX11-devel.x86_64
yum install libXext-devel.x86_64
yum install libXrender-devel.x86_64
yum install libXtst-devel.x86_64
yum install libXt-devel.x86_64
yum install libXi-devel.x86_64
yum install libXrandr-devel.x86_64
yum install cups-devel.x86_64
yum install fontconfig-devel.x86_64
yum install alsa-lib-devel.x86_64
##配置编译参数
cd /home/yym/code/jdk11-master
bash configure --with-num-cores=8 --with-memory-size=16,384 --with-boot-jdk=/home/yym/code/jdk-10.0.1 --with-debug-level=slowdebug --disable-warnings-as-errors
备注:
--with-num-cores=8 指8核cpu
--with-memory-size=16,384 指16G内存
--with-boot-jdk=/home/yym/code/jdk-10.0.1 指引导jdk路径
##编译openjdk11
make CONF=linux-x86_64-server-slowdebug
##使用编译完的openjdk11
/home/yym/code/jdk11-master/build/linux-x86_64-server-slowdebug/jdk/bin/java -version
##清除上一次编译
make clean CONF=linux-x86_64-server-slowdebug