build sun jdk1.6 源代码
来源:互联网 发布:北大在职研究生 知乎 编辑:程序博客网 时间:2024/06/06 16:27
最近为了研究jvm, 尝试build java 源代码。
网上有一些openjdk build教程,但是为了后期测试与应用方便,还是选定sun jdk.
感谢RednaxelaFX 同学的帮助,最终结果如下:
http://hllvm.group.iteye.com/group/topic/27149
1. 虽然jdk1.6 README-builds.html 里说要jdk1.5作为Bootstrap, 其实是要求1.6, 所以要先下载安装sun jdk-6u26-linux-x64.bin
注意这里用opensdk 是不行的,没有javap
2. 环境变量设置如下:
ALT_BOOTDIR=/tmp/jdk1.6.0_26
ALT_DEVTOOLS_PATH=/usr/bin
DEVTOOLS_PATH=/usr/bin
LANG=C
3. 安装cups, 下载并build cups-1.5.0-source.tar.bz2
4. 不知道为什么,下载的jdk1.6源码中少了字体文件,ERROR: Missing ./../src/share/lib/fonts/LucidaTypewriterRegular.ttf.
Verify you have downloaded and overlayed on the source area all the binary files.
不管它了,从现有的jre 里拷过来。
5. make dev-sanity 有一些warning, 先不管。
6. 执行make dev-sanity BUILD_DEPLOY=false SKIP_COMPARE_IMAGES=true ALT_BOOTDIR=/tmp/jdk1.6.0_26 ALT_DEVTOOLS_PATH=/usr/bin HOTSPOT_BUILD_JOBS=2
等着......明天来看结果
偶的新机器真快,20分钟不到就结束了,
和这里一样报错,看来还得来一次:http://rednaxelafx.iteye.com/blog/875957
make[3]: Entering directory `/mnt/hgfs/workplace/jdk6_src/motif/lib/Xm/util'
make[3]: *** No rule to make target `/usr/X11R6/lib/X11/config/Imake.tmpl', needed by `xmkmf'. Stop.
make[3]: Leaving directory `/mnt/hgfs/workplace/jdk6_src/motif/lib/Xm/util'
make[2]: *** [util/mkcatdefs] Error 2
make[2]: Leaving directory `/mnt/hgfs/workplace/jdk6_src/motif/lib/Xm'
make[2]: Entering directory `/mnt/hgfs/workplace/jdk6_src/motif/lib/Xm'
(cd util; make)
make[3]: Entering directory `/mnt/hgfs/workplace/jdk6_src/motif/lib/Xm/util'
make[3]: *** No rule to make target `/usr/X11R6/lib/X11/config/Imake.tmpl', needed by `xmkmf'. Stop.
make[3]: Leaving directory `/mnt/hgfs/workplace/jdk6_src/motif/lib/Xm/util'
make[2]: *** [util/mkcatdefs] Error 2
make[2]: Leaving directory `/mnt/hgfs/workplace/jdk6_src/motif/lib/Xm'
make[1]: *** [motif-build] Error 2
make[1]: Leaving directory `/mnt/hgfs/workplace/jdk6_src/control/make'
make: *** [dev-build] Error 2
现场直播, 报错了
make[3]: Entering directory `/mnt/hgfs/workplace/jdk6_src/motif/lib/Xm/util'
make[3]: *** No rule to make target `/usr/X11R6/lib/X11/config/Imake.tmpl', needed by `xmkmf'. Stop.
make[3]: Leaving directory `/mnt/hgfs/workplace/jdk6_src/motif/lib/Xm/util'
make[2]: *** [util/mkcatdefs] Error 2
make[2]: Leaving directory `/mnt/hgfs/workplace/jdk6_src/motif/lib/Xm'
make[2]: Entering directory `/mnt/hgfs/workplace/jdk6_src/motif/lib/Xm'
(cd util; make)
make[3]: Entering directory `/mnt/hgfs/workplace/jdk6_src/motif/lib/Xm/util'
make[3]: *** No rule to make target `/usr/X11R6/lib/X11/config/Imake.tmpl', needed by `xmkmf'. Stop.
make[3]: Leaving directory `/mnt/hgfs/workplace/jdk6_src/motif/lib/Xm/util'
make[2]: *** [util/mkcatdefs] Error 2
make[2]: Leaving directory `/mnt/hgfs/workplace/jdk6_src/motif/lib/Xm'
make[1]: *** [motif-build] Error 2
make[1]: Leaving directory `/mnt/hgfs/workplace/jdk6_src/control/make'
make: *** [dev-build] Error 2
估计是x11库的问题,检查jdk6_src\motif\lib\Xm\util\Makefile,用到了/usr/X11R6/lib
我的本机是没有这个目录的,从/usr/share 下找到了X11, 拷到/usr/X11R6/lib这里。
再build,还有错:
gcc -I/usr/X11R6/include -Dlinux -D__i386__ -D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_BSD_SOURCE -D_SVID_SOURCE -DFUNCPROTO=15 -DNARROWPROTO -c -o mkcatdefs.o mkcatdefs.c
mkcatdefs.c: In function 'mkcatdefs':
mkcatdefs.c:350: warning: cast to pointer from integer of different size
mkcatdefs.c:402: warning: cast to pointer from integer of different size
rm -f mkcatdefs
gcc -o mkcatdefs mkcatdefs.o
gcc -I/usr/X11R6/include -Dlinux -D__i386__ -D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_BSD_SOURCE -D_SVID_SOURCE -DFUNCPROTO=15 -DNARROWPROTO -c -o lndir.o lndir.c
lndir.c: In function 'quit':
lndir.c:104: warning: incompatible implicit declaration of built-in function 'exit'
lndir.c: In function 'quiterr':
lndir.c:112: warning: incompatible implicit declaration of built-in function 'exit'
lndir.c: In function 'main':
lndir.c:353: warning: incompatible implicit declaration of built-in function 'exit'
rm -f lndir
gcc -o lndir lndir.o
make[3]: Leaving directory `/mnt/hgfs/workplace/jdk6_src/motif/lib/Xm/util'
rm -f XmMsgI.h XmMsgCatI.h Xm.cat
./util/mkmsgcat -Xm ./Messages.c
mv -f Xm.msg Xm1.msg
./util/mkcatdefs XmMsgCatI.h Xm1.msg > Xm.msg
mkcatdefs: XmMsgCatI.h created
rm -f Xm1.msg
rm -f Xm.cat
gencat Xm.cat ./Xm.msg
./Xm.msg:2: unknown directive `': line ignored
./Xm.msg:16: unknown directive `': line ignored
make[2]: *** [Xm.cat] Error 1
make[2]: Leaving directory `/mnt/hgfs/workplace/jdk6_src/motif/lib/Xm'
make[2]: Entering directory `/mnt/hgfs/workplace/jdk6_src/motif/lib/Xm'
mkdir unshared
ln -s ../bindings/unshared unshared/bindings
ln: creating symbolic link `unshared/bindings' to `../bindings/unshared': Operation not supported
ln -s ../util/unshared unshared/util
ln: creating symbolic link `unshared/util' to `../util/unshared': Operation not supported
make[2]: *** [includes] Error 1
make[2]: Leaving directory `/mnt/hgfs/workplace/jdk6_src/motif/lib/Xm'
make[1]: *** [motif-build] Error 2
make[1]: Leaving directory `/mnt/hgfs/workplace/jdk6_src/control/make'
make: *** [dev-build] Error 2
估计还是X11问题,都怪俺装Centos时以为不会做X11 开发,安装省了许多相关库
经过多次折腾,今天张全部搞定了。
不知道什么原因,下载的src 包里总是少了各样的gif, wav等资源文件。
(需要的同学可以联系我,我都在网上找全的)
另外在amd64位下要改下\jdk6_src\j2se\make\sun\jdbc\Makefile 里$(TEMPDIR)/libodbcinst.so: dummyodbc.c $(TEMPDIR)
$(CC) -shared -fPIC -o $@ $<
$(TEMPDIR)/libodbc.so: dummyodbc.c $(TEMPDIR)
$(CC) -shared -fPIC -o $@ $<
- build sun jdk1.6 源代码
- SUN官方API中文版【JDK1.6】
- SUN官方API中文版【JDK1.6】
- SUN官方API中文版【JDK1.6】
- SUN官方API中文版【JDK1.6】
- Ubuntu下配置sun jdk1.6
- SUN官方API中文版【JDK1.6】
- SUN官方API中文版【JDK1.6】
- sun jdk1.6自带WebService实例分析【转】
- JDK1.6官方下载—SUN官方API中文版【JDK1.6】
- sun.misc.Unsafe源代码
- JDK1.8源代码
- 使用JDK1.6编译器API动态编译java源代码实例
- JDK1.6 安装--错误(找不到或无法加载主类 com.sun.tools.javac.Main)
- ubuntu12.04中配置sun jdk1.7
- JDK1.7中引用sun.management.ManagementFactory
- JDK1.7中引用sun.management.ManagementFactory
- JDK1.7 sun.net.ftp.FtpClient
- 转义符[全]
- 起航
- Web Services 教程
- thinking in java 笔记(1) 1~10
- xml的四种解析方法及源代码(SAX、DOM、JDOM、DOM4J)
- build sun jdk1.6 源代码
- JAVA判断字符串是否为数字
- 神秘的java Https (1)
- Struts 2.1在windows 7中的配置(Tomcat 6+JDK 6以及Eclipse )图文
- Dual Boot Windows and Ubuntu
- POJ-2388 who's in the middle
- MySQL外键设置
- 麦森数
- x-husky grid release