首页 新闻 会员 周边 捐助

Mac OS下编译openJDK的问题

0
悬赏园豆:50 [已解决问题] 解决于 2016-12-16 10:06

最近买了一本《深入理解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字库的问题,我也下载最新的了,请问接下来改怎么办???

AaronChun的主页 AaronChun | 初学一级 | 园豆:152
提问于:2014-08-24 21:12
< >
分享
最佳答案
1

在我的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++

祝你成功

收获园豆:50
ubnong | 菜鸟二级 |园豆:252 | 2014-11-09 19:53

多谢,成功解决!

曹老三 | 园豆:200 (初学一级) | 2016-04-24 19:07
其他回答(2)
0

看看这:

在Mac OSX下编译用于iOS的FreeType静态库

http://blog.k-res.net/archives/1041.html

LiuKaiFa | 园豆:1491 (小虾三级) | 2014-08-25 08:12

看了一遍,完全不懂啊。。。看着是给IOS编译的,能说的再具体一点儿吗???

支持(0) 反对(0) AaronChun | 园豆:152 (初学一级) | 2014-08-25 22:28
0

我也遇到一样的问题了,LZ解决了么?

Corpse | 园豆:202 (菜鸟二级) | 2014-09-29 22:19

没有,在网上搜索了,也没有找到合适的答案,在猪八戒网有看到这个问题的,但是貌似得收费。

支持(0) 反对(0) AaronChun | 园豆:152 (初学一级) | 2014-10-03 17:28
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册