`

centos 6.5 编译openjdk7

阅读更多

在centos6.5上编译openjdk7

第一步:查看当前os版本:

uname -a
Linux centos65 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

 第二步:环境准备:

1.首先去 这里 http://download.java.net/openjdk/jdk7/ 下载OpenJDK7的源码zip包

2.安装需要的包

sudo yum install cups-dev unzip zip freetype cmake gcc

3.设置环境变量

    export LANG=C  
    export ALT_BOOTDIR=/usr/java/jdk1.6.0_30/    --刚才下载的jdk7的放置的路径
    export ALLOW_DOWNLOADS=true  
    export USE_PRECOMPILED_HEADER=true  
    export SKIP_DEBUG_BUILD=false  
    export SKIP_FASTDEBUG_BUILD=true  
    export DEBUG_NAME=debug  
    unset CLASSPATH  
    unset JAVA_HOME

第三步:开始编译

   

make sanity --检测环境是否准备好
make --开始编译

 

编译的过程中遇到的问题

1 提示找不到cups.h 

是因为 cups-dev包没有安装,需要运行sudo yum install cups-dev

2:/home/#####/soft/java/openjdk-7-fcs-src-b147-27_jun_2011/openjdk/jaxp/build-defs.xml:70: ERROR: Cannot find source for project jaxp.

 

HINT: Try setting drops.dir to indicate where the bundles can be found, or try setting the ant property allow.downloads=true to download the bundle from the URL.

e.g. ant -Dallow.downloads=true -OR- ant -Ddrops.dir=some_directory

 

export LANG=C ALT_BOOTDIR=/usr/lib/jvm/java-6-openjdk ALLOW_DOWNLOADS=true

原因是刚才没有设置 ALLOW_DOWNLOADS=true

 3:Using java runtime at: /home/#####/soft/java/jdk1.7.0_71/jre

Error occurred during initialization of VM

Unable to load native library: /home/wangjw/soft/java/jdk1.7.0_71/jre/lib/amd64/libjava.so: symbol JVM_SetNativeThreadName, version SUNWprivate_1.1 not defined in file libjvm.so with link time reference

 这一步

 是一位安装的jdk7,然后换成jdk6

 

-- Build times ----------

Target all_product_build

Start 2014-11-09 19:17:48

End   2014-11-09 19:53:06

00:00:11 corba

00:00:20 hotspot

00:00:07 jaxp

00:00:13 jaxws

00:34:14 jdk

00:00:13 langtools

00:35:18 TOTAL

-------------------------

 

参考资料:

Linux 下编译自己的 OpenJDK7 包括JVM和JDK API

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics