编译JDK8历史版本
参考资料
工具准备
直接安装WindowsXP SP3的虚拟机并相关依赖工具
cygwin
使用支持winxp的版本
1 | setup-x86.exe --allow-unsupported-windows --site http://ctm.crouchingtigerhiddenfruitbat.org/pub/cygwin/circa/2016/08/30/104223 --no-verify |
必备工具命令
- git
- wget
- unzip
- zip
- cpio
- make
- gcc-g++
git
- 关闭crlf转换
- VisualStudio仅使用英文
OpenJDK
根据需要找到版本号,如 jdk8u121-b36 https://hg.openjdk.java.net/jdk8u/monojdk8u/rev/8b0e3c5074f2
构建
配置
1 | # bash configure --help 查看所有可用参数 |
编译
1 | make CONF= all |
报错处理
- Could not initialize class sun.font.SunFontManager
跟随jdk编译出的freetype2有问题,可以自己下载源码编译并在jdk编译时指定;
- 不能使用GnuWin32的freetype2
1 | 最终通过下载 |
- the trustAnchors parameter must be non-empty
参考 https://www.baeldung.com/java-trustanchors-parameter-must-be-non-empty
默认编译出来的jdk是缺少一些证书,这里可以简单从已有的jdk中复制来解决
比如从 jdk1.8.0_121的 java/security 覆盖