在http://jdk7.java.net/source.html下载打包好的源代码
我下载的是openjdk-7u40
准备环境
unset CLASSPATH
unset JAVA_HOME
export ALT_BOOTDIR=`/usr/libexec/java_home -v 1.6`
解压后,直接在根目录执行make命令
报错,找不到FreeType 2.3.0
去FreeType官网下载源码包编译安装
./configure && make && sudo make install
报错,仍然找不到FreeType 2.3.0
需要把freetype的头文件加入C_INCLUDE_PATH
export C_INCLUDE_PATH=/usr/local/include/freetype2
报错,org/omg/CORBA/ParameterModeHolder.java:5: ?????????????? ascii ??????????
export _JAVA_OPTIONS=-Dfile.encoding=ASCII
参考:http://d.hatena.ne.jp/dolduke/20110112
报错,‘stat64’ is deprecated
将src/os/bsd/vm/attachListener_bsd.cpp中的stat64替换为stat
参考:http://mail.openjdk.java.net/pipermail/hotspot-dev/2013-July/010392.html
报错,“X11/Xlib.h”: no such file or directory
原因:X11 is no longer included with OS X, but X11 server and client libraries for OS X are available from the XQuartz project: http://xquartz.macosforge.org.
http://support.apple.com/kb/ht5293
安装XQuartz,然后export C_INCLUDE_PATH=$C_INCLUDE_PATH:/usr/X11/include