「OpenJDK8u102-b14」

  CREATED BY JENKINSBOT

源码下载

依赖

必须的依赖:alsa-lib-1.1.2, cpio-2.12, Cups-2.1.4, UnZip-6.0, Which-2.21, Xorg Libraries, Zip-3.0

可选依赖:Certificate Authority Certificates, giflib-5.1.4, Wget-1.18

编译、安装

0x00,下载、解压 jdk8u102-b14.tar.bz2;

解压 jdk8u102-b14.tar.bz2,然后进入“
解压后的目录”,执行 0x01;

0x01,下载源码包的各个部分;

jdk 由很多部分组成,源码包被分为多个部分, 先下载:

cat > subprojects.md5 << EOF &&
6ea4a074a80d0ee4b6dcd50398835c49  corba.tar.bz2
27b9e7e94fc6a47f452e8a94ba156395  hotspot.tar.bz2
da82a91df3eb4c98ebaab4e71cbbcc4d  jaxp.tar.bz2
8a91561bbc04f50a92032d82b78960e0  jaxws.tar.bz2
61c645dbacfb925944f716ec50474821  langtools.tar.bz2
e65f6d029808a8b523e07d818c8ac9ad  jdk.tar.bz2
2c981235c1cbaba58197fd9b7ffd00e1  nashorn.tar.bz2
EOF

for subproject in corba hotspot jaxp jaxws langtools jdk nashorn; do
  wget -c http:hg.openjdk.java.net/jdk8u/jdk8u/${subproject}/archive/jdk8u102-b14.tar.bz2 \//
       -O ${subproject}.tar.bz2
done &&

md5sum -c subprojects.md5 &&

for subproject in corba hotspot jaxp jaxws langtools jdk nashorn; do
  mkdir -pv ${subproject} &&
  tar -xf ${subproject}.tar.bz2 --strip-components=1 -C ${subproject}
done

脚本的主要目的是
下载jdk的组成部分,然后解压到”
当前目录“;

*: 这期间可能出现下载失败的问题,或者校验失败,手动下载按照脚本执行就可以了:)

0x02,编译

unset JAVA_HOME               &&
sh ./configure                \
   --with-update-version=102   \
   --with-build-number=b14    \
   --with-milestone=nth      \
   --enable-unlimited-crypto  \
   --with-zlib=system         \
   --with-giflib=system       \
   --with-extra-cflags="-std=c++98 -Wno-error -fno-delete-null-pointer-checks -fno-lifetime-dse" \
   --with-extra-cxxflags="-std=c++98 -fno-delete-null-pointer-checks -fno-lifetime-dse" &&
make DEBUG_BINARIES=true SCTP_WERROR= all  &&
find build/*/images/j2sdk-image -iname \*.diz -delete

0x03,安装、并修改权限;

cp -RT build/*/images/j2sdk-image /opt/OpenJDK-1.8.0.102 &&
chown -R root:root /opt/OpenJDK-1.8.0.102

JDK 目录结构

java-open-8u102
├── ASSEMBLY_EXCEPTION
├── bin
├── demo
├── include
├── jre
├── lib
├── LICENSE
├── man
├── release
├── sample
├── src.zip
└── THIRD_PARTY_README

bin 目录下命令介绍

OpenJDK Tools List