在我的机器上 ./hotspot 会出现错误

RT。错误是:

1
2
<YourOpenJDK>/build/macosx-x86_64-normal-server-slowdebug/hotspot/bsd_amd64_compiler2/debug   ./hotspot
Error: Cannot find the java launcher "/java/re/j2se/1.8.0/promoted/latest/binaries/bsd-amd64/bin/java"

通过查找 Makefile 中 hotspot.script 文件中此错误位置发现需要引用环境变量 ALT_JAVA_HOME。因而只要 export ALT_JAVA_HOME=<YourOpenJDK>/build/macosx-x86_64-normal-server-slowdebug/images/j2sdk-bundle/jdk1.8.0.jdk/Contents/Home 即可。