下载
我使用的环境是
ubuntu 16.04 基本上属于ubuntu 的最新版本所以建议下载openjdk的最新开发分支的代码
否则会有个中问题的
下载链接
http://openjdk.java.net/projects/jdk8u/
openjdk使用了hg作为版本控制的工具
hg clone http://hg.openjdk.java.net/jdk8u/jdk8u
cd jdk8u
sh get_source.sh
我使用上面的命令下载的jdk8主线代码
上面会遇到类似如下问题
abort: stream ended unexpectedly (got 6117 bytes, expected 6563)
这个的主要原因是因为网络和服务器链接不好,导致超时退出
可以使用如下patch 修改get_source.sh,然后呢,循环下载直到下载完成为止
diff -r a0672a294b9a get_source.sh
--- a/get_source.sh Tue Oct 24 13:15:02 2017 -0700
+++ b/get_source.sh Fri Dec 29 18:33:48 2017 +0800
@@ -94,7 +94,16 @@
# Get clones of all absent nested repositories (harmless if already exist)
-sh ./common/bin/hgforest.sh clone "$@" || exit $?
+sh ./common/bin/hgforest.sh clone "$@"
+while [ $? -ne 0 ]
+do
+sh ./common/bin/hgforest.sh clone "$@"
+done
# Update all existing repositories to the latest sources
sh ./common/bin/hgforest.sh pull -u
+while [ $? -ne 0 ]
+do
+sh ./common/bin/hgforest.sh pull -u
+done
+
编译过程是比较顺利的
chmod +x configure
./configure --prefix=~/workdir/art-dalvik/jdk8u/out/ --enable-debug
make
make install
OK 到此编译通过了