系统环境:
CentOS Linux release 7.9.2009 (Core)
openjdk version "1.8.0_332"
OpenJDK Runtime Environment (build 1.8.0_332-b09)
OpenJDK 64-Bit Server VM (build 25.332-b09, mixed mode)
1.下载jdk源码
git clone https://github.com/openjdk/jdk.git
2.切换分支
git checkout jdk8-b120
git checkout -b jdk8-b120
3.构建
bash configure
make all
4.过程中遇到的问题解决
1.make过程
问题:
Exception in thread "main" java.lang.VerifyError:class jdk.nashorn.internal.objects.ScriptFunctionImpl overrides final method setPrototype.(Ljava/lang/Object;)V
修复方式:
nashorn/make/BuildNashorn.gmk第80行
-cp "$(NASHORN_OUTPUTDIR)/nasgen_classes$(PATH_SEP)$(NASHORN_OUTPUTDIR)/nashorn_classes" \
改为
-Xbootclasspath/p:"$(NASHORN_OUTPUTDIR)/nasgen_classes$(PATH_SEP)$(NASHORN_OUTPUTDIR)/nashorn_classes" \