步骤
- 首先,编译需要一个JDK。openJDK17需要JDK16,openJDK17的源码我在https://openjdk-sources.osci.io/下载,JDK16我在oracle官网下载已编译的包:https://www.oracle.com/java/technologies/javase/jdk16-archive-downloads.html
- 安装依赖软件,别的教程是libX11-devel, libXext-devel, libXrender-devel, libXrandr-devel, libXtst-devel, libXt-devel, libXi-devel, cpus-devel, fontconfig-devel, alsa-devel, 用apt-get下载的话要改成以下:
console
sudo apt-get update
sudo apt-get install autoconf zypper
sudo apt-get install libx11-dev libxext-dev libxrender-dev libxrandr-dev libxtst-dev libxt-dev libxi-dev
sudo apt-get install libcups2-dev
sudo apt-get install libfontconfig-dev
sudo apt-get install libasound2-dev
- 解压openjdk17和jdk16的压缩包
console
cd /home/kiramario/software/jdk-17.0.2-ga
bash configure --with-debug-level=slowdebug --with-target-bits=64 --disable-warnings-as-errors --with-jvm-variants=server --with-boot-jdk=/home/kiramario/software/jdk-16.0.2
sudo make all
sudo make install
结果
console
Building target 'install' in configuration 'linux-x86_64-server-slowdebug'
Warning: No SCM configuration present and no .src-rev
Installing jdk image into /usr/local/jvm/openjdk-17.0.2-internal
and creating 56 links from /usr/local/bin into the jdk.
Finished building target 'install' in configuration 'linux-x86_64-server-slowdebug'