一 基礎(chǔ)套件安裝
1.openjdk代碼由hg管理喳张,因此需要安裝mercurial
brew install mercurial
2舟舒、安裝ccache提高編譯速度
brew install ccache
3肖爵、安裝freetype(編譯時需要)
brew install freetype
二 下載源碼
hg clone http://hg.openjdk.java.net/jdk9/jdk9
cd jdk9
bash ./get_source.sh
三 編譯配置
bash configure --with-target-bits=64 --with-freetype=/usr/local/Cellar/freetype/2.8 --enable-ccache --with-jvm-variants=server,client --with-boot-jdk-jvmargs="-Xlint:deprecation -Xlint:unchecked" --disable-zip-debug-info --disable-warnings-as-errors --with-debug-level=slowdebug 2>&1 | tee configure_mac_x64.log
四 編譯
export LANG=C
make all LOG=debug2>&1| tee make_mac_x64.log
五 測試
/Users/qiyekun/github/jdk9/build/macosx-x86_64-normal-serverANDclient-slowdebug/jdk/bin/java -version