MAC编译openjdk

  1. 配置mac环境:brew install freetype ccache,安装xcode,gcc和make都需要
  2. 代码推荐https://hg.openjdk.java.net/jdk/jdk12/ 去获取zip包(点击browse->zip)
  3. 下载解压后 chmod +x configure,可以configure --help查看编译参数
  4. 使用./configure --with-debug-level=slowdebug --enable-dtrace --with-jvm-variants=server --with-target-bits=64 --enable-ccache --with-num-cores=4 --with-memory-size=8000 --disable-warnings-as-errors 因为编译的时候会有一些warning为error的情况,所以加上--disable-warnings-as-errors,成功会提示 A new configure has been successful created in ...
  5. 用make来编译:make image
  6. 验证:build/macosx-x86_64-server-slowdebug/jdk/bin/java --version
comments powered by Disqus