+ -
当前位置:首页 → 问答吧 → 有关SUN jdk编译,欢迎大家讨论

有关SUN jdk编译,欢迎大家讨论

时间:2008-11-17

来源:互联网

资料1: http://download.java.net/jdk6/6u3/pr...ME-builds.html
以上是 sun官方的编译指南。

我之前的一个讨论帖子:
资料2: http://www.linuxsir.org/bbs/thread337713.html

作者: think365   发布时间: 2008-11-17

资料1中提到:
All JDK builds require access to the previously released JDK 5.0, this is often called a bootstrap JDK. The JDK 5.0 binaries can be downloaded from Sun's JDK 5.0 download site. For build performance reasons is very important that this JDK be made available on the local disk of the machine doing the build. You should always set ALT_BOOTDIR to point to the location of the bootstrap JDK installation, this is the directory pathname that contains a bin, lib, and include It's also a good idea to also place its bin directory in the PATH environment variable, although it's not required.

即对jdk6的编译需要用到 jdk5, 我从http://java.sun.com/j2se/1.5.0/download.html
下载了java_ee_sdk-5_01-linux.bin,
但是安装不了。。。
出错信息如下所示:
[root@~]#./java_ee_sdk-5_01-linux.bin
./java_ee_sdk-5_01-linux.bin: error while loading shared libraries: libstdc++.so.5: cannot open shared object file: No such file or directory

我知道是共享库的问题。
我机上的是libstdc++.so.6,版本太高的。。。
如下可知,我机上的版本是libstdc++.so.6
ls /usr/lib/libstdc++.*
/usr/lib/libstdc++.a /usr/lib/libstdc++.so /usr/lib/libstdc++.so.6.0.8
/usr/lib/libstdc++.la /usr/lib/libstdc++.so.6

这样的话,java_ee_sdk-5_01-linux.bin用啥办法能装到我机子上呢?

作者: think365   发布时间: 2008-11-17

做个连接,让 so.6 与so.5 相同,试一下看看。

作者: qufo   发布时间: 2008-11-17

编译gcc3

作者: newper   发布时间: 2008-11-18

引用:
作者: qufo
做个连接,让 so.6 与so.5 相同,试一下看看。
ln -s libstdc++.so.6.0.8 libstdc++.so.5
[root@/usr/lib]#ls libstdc++.* -l
-rw-r--r-- 1 root root 7737944 2008-11-07 09:41 libstdc++.a
-rwxr-xr-x 1 root root 944 2008-11-07 09:41 libstdc++.la
lrwxrwxrwx 1 root root 18 2008-11-07 09:41 libstdc++.so -> libstdc++.so.6.0.8
lrwxrwxrwx 1 root root 18 2008-11-18 01:37 libstdc++.so.5 -> libstdc++.so.6.0.8
lrwxrwxrwx 1 root root 18 2008-11-07 09:41 libstdc++.so.6 -> libstdc++.so.6.0.8
-rwxr-xr-x 1 root root 4406218 2008-11-07 09:41 libstdc++.so.6.0.8



./java_ee_sdk-5_01-linux.bin
Checking available disk space...
Checking Java(TM) 2 Runtime Environment...
Extracting Java(TM) 2 Runtime Environment files...
Extracting installation files...
Launching Java(TM) 2 Runtime Environment...
Attach to native process failed
Deleting temporary files...

安装失败,这样做不行

作者: think365   发布时间: 2008-11-18

引用:
作者: newper
编译gcc3
gcc --version
gcc (GCC) 4.1.2
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
关键我机子上现在整套工具链都是 用4.1.2 gcc编译的啊,
你的意思是,我把整个工具链改为 用gcc3.0编译?

作者: think365   发布时间: 2008-11-18

no 编译gcc3再把libstdc++.so.5复制过去

作者: newper   发布时间: 2008-11-18

这方面 BLFS 手册里有说明的,可是楼主已脱离了 BLFS

作者: d00m3d   发布时间: 2008-11-19

引用:
作者: newper
no 编译gcc3再把libstdc++.so.5复制过去
你的意思是,系统同时存在两套库吗?
一套3.0的,一套4.1的?

作者: think365   发布时间: 2008-11-19

gcc 可以多版共存,俺系统里就有 gcc-4.2.4,gcc-4.3.2,gcc-4.4-20081114 等,呵呵

作者: d00m3d   发布时间: 2008-11-19

如果是 openjdk 自己编译一下还好,但 sun jdk 直接用二进制版本好了。

作者: 聚焦深空   发布时间: 2008-11-20