64位CentOS7下编译openjdk7u60

几天前在32位ubuntu14下编译了openjdk7u40,又试着在64位CentOS7下编译了openjdk7u60。


这次是按照官方发布的编译说明(README-builds.html)进行的。

先安装好ant、cups等信赖,然后获取源码:

hg clone http://hg.openjdk.java.net/jdk7/jdk7 YourOpenJDK 
cd YourOpenJDK 
sh ./get_source.sh

这次直接使用Oracle JDK,编译脚本类似。

********************************************************

export LANG=C
export ALT_BOOTDIR=/usr/java/jdk1.6.0_45


export ALLOW_DOWNLOADS=true


export HOTSPOT_BUILD_JOBS=4
export ALT_PARALLEL_COMPILE_JOBS=4


export SKIP_COMPARE_IMAGES=true


export USE_PRECOMPILED_HEADER=true


export BUILD_LANGTOOLS=true
#export BUILD_JAXP=false
#export BUILD_JAXWS=false
#export BUILD_CORBA=false
export BUILD_HOTSPOT=true
export BUILD_JDK=true


BUILD_DEPLOY=false
BUILD_INSTALL=false


unset JAVA_HOME
unset CLASSPATH


#make sanity
make 2>&1 | tee build.log

********************************************************


这次遇到了一些新的问题:

1. 

/usr/bin/ld: cannot find -lstdc++

ln: accessing `libjvm.so.1': Too many levels of symbolic links

网上有人说应该用32位的libstdc++,而且README-builds.html也给出了提示:

  • Error Message: libstdc++ not found:
    This is caused by a missing libstdc++.a library. This is installed as part of a specific package (e.g. libstdc++.so.devel.386). By default some 64-bit Linux versions (e.g. Fedora) only install the 64-bit version of the libstdc++ package. Various parts of the JDK build require a static link of the C++ runtime libraries to allow for maximum portability of the built images.
但并没有给出解决方案。64位系统下安装32位库遇到冲突,无法安装,最后参考http://mail.openjdk.java.net/pipermail/jdk7u-dev/2012-August/004174.html解决。

原来是stdc++版本的问题:

It is the "static-devel" package that is required by OpenJDK.

2. 
fatal error: X11/extensions/XTest.h: No such file or directory

解决方法:yum install libXtst-devel

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值