最近买了一本《深入理解Java虚拟机》的书,书中第一章描写怎么样编译openJDK,我自己在编译的过程当中出错了,由于对unix/Linux知之甚少,找了好多,都没有解决。
接下来贴出使用 make sanity命令输出的一部分内容:
Target Build Versions: JDK_VERSION = 1.7.0 MILESTONE = internal RELEASE = 1.7.0-internal FULL_VERSION = 1.7.0-internal-aichangchun_2014_08_24_20_57-b00 BUILD_NUMBER = b00 External File/Binary Locations: USRJDKINSTANCES_PATH = /opt/local BUILD_JDK_IMPORT_PATH = /NOT-SET/re/jdk/1.7.0/promoted/latest/binaries ALT_BUILD_JDK_IMPORT_PATH = JDK_IMPORT_PATH = /NOT-SET/re/jdk/1.7.0/promoted/latest/binaries/macosx-x86_64 ALT_JDK_IMPORT_PATH = LANGTOOLS_DIST = ALT_LANGTOOLS_DIST = /Users/aichangchun/openjdk/build/macosx-x86_64/langtools/dist CORBA_DIST = ALT_CORBA_DIST = /Users/aichangchun/openjdk/build/macosx-x86_64/corba/dist JAXP_DIST = ALT_JAXP_DIST = /Users/aichangchun/openjdk/build/macosx-x86_64/jaxp/dist JAXWS_DIST = ALT_JAXWS_DIST = /Users/aichangchun/openjdk/build/macosx-x86_64/jaxws/dist HOTSPOT_DOCS_IMPORT_PATH = /NO_DOCS_DIR ALT_HOTSPOT_DOCS_IMPORT_PATH = HOTSPOT_IMPORT_PATH = /Users/aichangchun/openjdk/build/macosx-x86_64/hotspot/import ALT_HOTSPOT_IMPORT_PATH = /Users/aichangchun/openjdk/build/macosx-x86_64/hotspot/import HOTSPOT_SERVER_PATH = /Users/aichangchun/openjdk/build/macosx-x86_64/hotspot/import/jre/lib/server ALT_HOTSPOT_SERVER_PATH = CACERTS_FILE = ./../src/share/lib/security/cacerts ALT_CACERTS_FILE = CUPS_HEADERS_PATH = /usr/include ALT_CUPS_HEADERS_PATH = OpenJDK-specific settings: FREETYPE_HEADERS_PATH = /usr/local/include/freetype2 ALT_FREETYPE_HEADERS_PATH = /usr/local/include/freetype2 FREETYPE_LIB_PATH = /usr/local/lib ALT_FREETYPE_LIB_PATH = /usr/local/lib Previous JDK Settings: PREVIOUS_RELEASE_PATH = ALT_PREVIOUS_RELEASE_PATH = PREVIOUS_JDK_VERSION = 1.6.0 ALT_PREVIOUS_JDK_VERSION = PREVIOUS_JDK_FILE = ALT_PREVIOUS_JDK_FILE = PREVIOUS_JRE_FILE = ALT_PREVIOUS_JRE_FILE = PREVIOUS_RELEASE_IMAGE = ALT_PREVIOUS_RELEASE_IMAGE = ERROR: The Compiler version is undefined. ERROR: FreeType version 2.3.0 or higher is required. /bin/mkdir -p /Users/aichangchun/openjdk/build/macosx-x86_64/btbins rm -f /Users/aichangchun/openjdk/build/macosx-x86_64/btbins/freetype_versioncheck Failed to build freetypecheck. Exiting because of the above error(s).
标红的是报的错误,说我本机FreeType字库的问题,我也下载最新的了,请问接下来改怎么办???
在我的mac本里解决了。
原因是Xcode5.0之后不再提供llvm-gcc与llvm-g++这两样东西,编译jdk是需要这两个所以一直出错。
解决方法是在你的Xcode的/usr/bin(
/Applications/Xcode.app/Contents/Developer/usr/bin 这是我的目录仅供参考
)下做一个ln -s的链接连到/usr/bin(这个/usr/bin与前面的不同)的 llvm-g++ llvm-gcc中
例子:sudo ln -s /usr/bin/llvm-g++ /Applications/Xcode.app/Contents/Developer/usr/bin/llvm-g++
祝你成功
多谢,成功解决!
看了一遍,完全不懂啊。。。看着是给IOS编译的,能说的再具体一点儿吗???
我也遇到一样的问题了,LZ解决了么?
没有,在网上搜索了,也没有找到合适的答案,在猪八戒网有看到这个问题的,但是貌似得收费。