自己编译JDK
-
下载ZIP文件
https://gitee.com/isspark/OpenJDK12
-
解压
unzip -o -d /root/jdk/ isspark-OpenJDK12-master.zip
-
下载openjdk11
yum install java-11-openjdk-devel -y
-
配置
bash configure
出错:
configure: error: Could not find all X11 headers (shape.h Xrender.h Xrander.h XTest.h Intrinsic.h). You might be able to fix this by running 'sudo yum install libXtst-devel libXt-devel libXrender-devel libXrandr-devel libXi-devel'.
安装依赖
sudo yum install libXtst-devel libXt-devel libXrender-devel libXrandr-devel libXi-devel -y
再次执行
configure: error: Could not find cups! You might be able to fix this by running 'sudo yum install cups-devel'.
yum install cups-devel -y
接下去还会遇到不少依赖问题,跟着提示安装
结果:
A new configuration has been successfully created in /root/jdk/OpenJDK12/build/linux-x86_64-server-release using default settings. Configuration summary: * Debug level: release * HS debug level: product * JVM variants: server * JVM features: server: 'aot cds cmsgc compiler1 compiler2 epsilongc g1gc graal jfr jni-check jvmci jvmti management nmt parallelgc serialgc services shenandoahgc vm-structs zgc' * OpenJDK target: OS: linux, CPU architecture: x86, address length: 64 * Version string: 12.0.2-internal+0-adhoc.root.OpenJDK12 (12.0.2-internal) Tools summary: * Boot JDK: openjdk version "11.0.8" 2020-07-14 LTS OpenJDK Runtime Environment 18.9 (build 11.0.8+10-LTS) OpenJDK 64-Bit Server VM 18.9 (build 11.0.8+10-LTS, mixed mode, sharing) (at /usr/lib/jvm/java-11-openjdk-11.0.8.10-0.el7_8.x86_64) * Toolchain: gcc (GNU Compiler Collection) * C Compiler: Version 4.8.5 (at /usr/bin/gcc) * C++ Compiler: Version 4.8.5 (at /usr/bin/g++) Build performance summary: * Cores to use: 1 * Memory limit: 1819 MB
-
运行make
make image time make image
估计得花不少时间(我只分配了2颗核心 2G内存)
Stopping sjavac server
Finished building target ‘images’ in configuration ‘linux-x86_64-server-release’real 69m10.253s
user 49m10.483s
sys 6m52.374s