1 下载 openjdk : https://jdk7.java.net/source.html
2 build 依赖工具下载 : 1 gcc ,make 2 cpus 3 alsa 4 零碎工具
3 环境变量配置脚本:
#!/bin/bash
export LANG=C
export ALT_BOOTDIR=/usr/bin/ jdk #!!!!!!!!! 用来编译的完整jdk
export ALLOW_DOWNLOADS=true #是否需要自动下载,jaxp,jaws可以自动下载
export SKIP_DEBUG_BUILD=false #是否跳过编译debug版
export SKIP_FASTDEBUG_BUILD=false #是否跳过编译fastdebug版
export DEBUG_NAME=debug
#-------------------
export BUILD_LANGTOOLS=true
export BUILD_JAXWS=true
export BUILD_CORBA=true
export BUILD_JAXP=true
export BUILD_HOTSPOT=true
export BUILD_JDK=true
unset CLASSPATH
unset JAVA_HOME
make sanity && make
4 启动脚本
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!ps 遇到的 报错
1 hotspot :http://my.oschina.net/u/2358721/blog/525510 gamma: 去掉 hotspot/make/linux/MakeFile 中的所有test_gamma
2 hotspot vim `find . -name 'CurrencyData.properties'` 把里面的时间改在10年之内 文件应该是 ./jdk/src/share/classes/java/util/CurrencyData.properties
3 hotspot X11/extensions/Xrender.h --->install xrender ; X11/extensions/shape.h -->install libxi-dev
总结:success build openjdk
本文详细介绍了从源码编译OpenJDK的过程,包括下载OpenJDK源码、安装必要的构建工具、配置环境变量及编译过程中的常见错误解决方法。
4960

被折叠的 条评论
为什么被折叠?



