Loading

Linux CentOS 6.9 Minimal 编译 OpenJDK 7

今天学习《深入理解Java虚拟机:JVM高级特性与最佳实践》一书,并动手在Linux系统上编译OpenJDK 7,初次搞不太顺利,特记录下编译操作细节。

一、前期准备

约定:工具默认安装目录是/usr/local/,若有源码,则源码存放在/usr/local/src/目录下,笔者用到的工具已打包上传到百度云:https://pan.baidu.com/s/1WhsQHJvduK75EBE8lQqq9g

  1、编译需要的相关工具

    yum -y install gcc gcc-c++ alsa-lib alsa-lib-devel libXrender libXrender-devel libXi-devel libXt-devel libXtst-devel cups cups-devel

2、FreeType

笔者使用的是freetype-2.4.0.tar.gz,下载地址:https://sourceforge.net/projects/freetype/files/freetype2/2.4.0/

tar -zxvf freetype-2.4.0.tar.gz    # 解压

cd freetype-2.4.0

./configure && make && make install    # 编译安装

3、Apache Ant

笔者使用的是apache-ant-1.9.7-bin.tar.gz,下载地址:https://archive.apache.org/dist/ant/binaries/

tar -zxvf apache-ant-1.9.7-bin.tar.gz  # 解压

mv apache-ant-1.9.7 /usr/local/

ln -s /usr/local/apache-ant-1.9.7/bin/ant /usr/bin/ant  # 软链接到bin

4、BootstrapJDK

笔者使用的是jdk-6u45-linux-x64,因为源码更多是使用Java写的,因此需要使用一个可用的JDK去编译(详见深入理解Java虚拟机第一章),OpenJDK解压目录下有个README-builds.html<OpenJDK Build README>,建议详看一遍,文档说使用JDK 6

下载jdk-6u45-linux-x64.bin,下载地址:http://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase6-419409.html

./jdk-6u45-linux-x64.bin    # 解压

mv jdk1.6.0_45 /usr/local/  # 移动目录

  5、OpenJDK

下载OpenJDK 7,地址:http://download.java.net/openjdk/jdk7/promoted/b147/openjdk-7-fcs-src-b147-27_jun_2011.zip,文件校验码:http://download.java.net/openjdk/jdk7/promoted/b147/openjdk-7-fcs-src-b147-27_jun_2011.md5

wget http://download.java.net/openjdk/jdk7/promoted/b147/openjdk-7-fcs-src-b147-27_jun_2011.zip   # 下载

unzip openjdk-7-fcs-src-b147-27_jun_2011.zip   # 解压

mv openjdk openjdk7  # 更改目录名

mkdir /usr/local/openjdk7  # 创建编译结果存放目录

二、配置环境变量

vim /etc/profile  # 在末尾加入以下内容注意各个目录Path

# openjdk 7 build
export ANT_HOME=/usr/local/apache-ant-1.9.7
export ALT_FREETYPE_HEADERS_PATH=/usr/local/include/freetype2
export ALT_FREETYPE_LIB_PATH=/usr/local/lib
export ALT_DROPS_DIR=/usr/local/src/openjdk7/drop
export ALT_BOOTDIR=/usr/local/jdk1.6.0_45
export ALT_JDK_IMPORT_PATH=/usr/local/jdk1.6.0_45
export ALT_OUTPUTDIR=/usr/local/openjdk7
export LANG=C  # default: en_US.UTF-8
export HOTSPOT_BUILD_JOBS=8
export ALT_PARALLEL_COMPILE_JOBS=8
export SKIP_COMPARE_IMAGES=true
export USE_PRECOMPILED_HEADER=true
export ALLOW_DOWNLOADS=true
export SKIP_DEBUG_BUILD=false
export SKIP_FASTDEBUG_BUILD=true
export DEBUG_NAME=debug
unset JAVA_HOME
unset CLASSPATH

  :wq  # 写入磁盘

  source /etc/profile  # 刷新环境变量配置使之生效,建议echo下几个配置项确认生效,例:echo $LANG

  cd openjdk7  # 进入OpenJDK解压目录

  make sanity   # 检查之前的配置是否正确,若无错误(Sanity check passed.)则OK,下面是笔者的执行结果宫参考

[root@dsp-centos-1-6_9 openjdk7]# make sanity
( cd  ./jdk/make && \
          make sanity HOTSPOT_IMPORT_CHECK=false JDK_TOPDIR=/usr/local/src/openjdk7/jdk JDK_MAKE_SHARED_DIR=/usr/local/src/openjdk7/jdk/make/common/shared EXTERNALSANITYCONTROL=true SOURCE_LANGUAGE_VERSION=7 TARGET_CLASS_VERSION=7 MILESTONE=internal BUILD_NUMBER=b00 JDK_BUILD_NUMBER=b00 FULL_VERSION=1.7.0-internal-debug-root_2018_05_01_00_10-b00 PREVIOUS_JDK_VERSION=1.6.0 JDK_VERSION=1.7.0 JDK_MKTG_VERSION=7 JDK_MAJOR_VERSION=1 JDK_MINOR_VERSION=7 JDK_MICRO_VERSION=0 PREVIOUS_MAJOR_VERSION=1 PREVIOUS_MINOR_VERSION=6 PREVIOUS_MICRO_VERSION=0 ARCH_DATA_MODEL=64 VARIANT=DBG DEBUG_CLASSFILES=true COOKED_BUILD_NUMBER=0 ANT_HOME="/usr/local/apache-ant-1.9.7" ALT_OUTPUTDIR=/usr/local/openjdk7 ALT_LANGTOOLS_DIST=/usr/local/openjdk7/langtools/dist ALT_CORBA_DIST=/usr/local/openjdk7/corba/dist ALT_JAXP_DIST=/usr/local/openjdk7/jaxp/dist ALT_JAXWS_DIST=/usr/local/openjdk7/jaxws/dist ALT_HOTSPOT_IMPORT_PATH=/usr/local/openjdk7/hotspot/import BUILD_HOTSPOT=true ; )
make[1]: Entering directory `/usr/local/src/openjdk7/jdk/make'
make[1]: Leaving directory `/usr/local/src/openjdk7/jdk/make'

Build Machine Information:
   build machine = dsp-centos-3-6_9

Build Directory Structure:
   CWD = /usr/local/src/openjdk7
   TOPDIR = .
   LANGTOOLS_TOPDIR = ./langtools
   JAXP_TOPDIR = ./jaxp
   JAXWS_TOPDIR = ./jaxws
   CORBA_TOPDIR = ./corba
   HOTSPOT_TOPDIR = ./hotspot
   JDK_TOPDIR = ./jdk

Build Directives:
   BUILD_LANGTOOLS = true 
   BUILD_JAXP = true 
   BUILD_JAXWS = true 
   BUILD_CORBA = true 
   BUILD_HOTSPOT = true 
   BUILD_JDK    = true 
   DEBUG_CLASSFILES =  
   DEBUG_BINARIES =  

Hotspot Settings: 
      HOTSPOT_BUILD_JOBS  = 8 
      HOTSPOT_OUTPUTDIR   = /usr/local/openjdk7/hotspot/outputdir 
      HOTSPOT_EXPORT_PATH = /usr/local/openjdk7/hotspot/import 
 



Bootstrap Settings:
  BOOTDIR = /usr/local/jdk1.6.0_45
    ALT_BOOTDIR = /usr/local/jdk1.6.0_45
  BOOT_VER = 1.6.0 [requires at least 1.6]
  OUTPUTDIR = /usr/local/openjdk7
    ALT_OUTPUTDIR = /usr/local/openjdk7
  ABS_OUTPUTDIR = /usr/local/openjdk7
 
Build Tool Settings:
  SLASH_JAVA = /NOT-SET
    ALT_SLASH_JAVA = 
  VARIANT = DBG
  JDK_DEVTOOLS_DIR = /NOT-SET/devtools
    ALT_JDK_DEVTOOLS_DIR = 
  ANT_HOME = /usr/local/apache-ant-1.9.7
  UNIXCOMMAND_PATH = /bin/
    ALT_UNIXCOMMAND_PATH = 
  COMPILER_PATH = /usr/bin/
    ALT_COMPILER_PATH = 
  DEVTOOLS_PATH = /usr/bin/
    ALT_DEVTOOLS_PATH = 
  UNIXCCS_PATH = /usr/ccs/bin/
    ALT_UNIXCCS_PATH = 
  USRBIN_PATH = /usr/bin/
    ALT_USRBIN_PATH = 
  COMPILER_NAME = GCC4
  COMPILER_VERSION = GCC4
  CC_VER = 4.4.7 [requires at least 4.3.0]
  ZIP_VER = 3.0 [requires at least 2.2]
  UNZIP_VER = 6.00 [requires at least 5.12]
  ANT_VER = 1.9.7 [requires at least 1.7.1]
  TEMPDIR = /usr/local/openjdk7/tmp
 
Build Directives:
  OPENJDK = true
  USE_HOTSPOT_INTERPRETER_MODE = 
  PEDANTIC = 
  DEV_ONLY = 
  NO_DOCS = 
  NO_IMAGES = 
  TOOLS_ONLY = 
  INSANE = 
  COMPILE_APPROACH = parallel
  PARALLEL_COMPILE_JOBS = 8
    ALT_PARALLEL_COMPILE_JOBS = 8
  FASTDEBUG = 
  COMPILER_WARNINGS_FATAL = false
  COMPILER_WARNING_LEVEL = 
  SHOW_ALL_WARNINGS = 
  INCREMENTAL_BUILD = false
  CC_HIGHEST_OPT = 
  CC_HIGHER_OPT = 
  CC_LOWER_OPT = 
  CXXFLAGS =  -g -fPIC -DCC_NOEX -W -Wall  -Wno-unused -Wno-parentheses -fno-omit-frame-pointer -D_LITTLE_ENDIAN  
  CFLAGS =  -g   -fno-strict-aliasing -fPIC -W -Wall  -Wno-unused -Wno-parentheses -pipe -fno-omit-frame-pointer -D_LITTLE_ENDIAN  
  BOOT_JAVA_CMD = /usr/local/jdk1.6.0_45/bin/java -XX:-PrintVMOptions -XX:+UnlockDiagnosticVMOptions -XX:-LogVMOutput -Xmx512m -Xms512m -XX:PermSize=32m -XX:MaxPermSize=160m
  BOOT_JAVAC_CMD = /usr/local/jdk1.6.0_45/bin/javac  -J-XX:ThreadStackSize=1536 -J-XX:-PrintVMOptions -J-XX:+UnlockDiagnosticVMOptions -J-XX:-LogVMOutput -J-Xmx512m -J-Xms512m -J-XX:PermSize=32m -J-XX:MaxPermSize=160m -encoding ascii -source 6 -target 6 -XDignore.symbol.file=true
  BOOT_JAR_CMD = /usr/local/jdk1.6.0_45/bin/jar
  BOOT_JARSIGNER_CMD = /usr/local/jdk1.6.0_45/bin/jarsigner
  JAVAC_CMD = /usr/local/jdk1.6.0_45/bin/java -XX:-PrintVMOptions -XX:+UnlockDiagnosticVMOptions -XX:-LogVMOutput -Xmx512m -Xms512m -XX:PermSize=32m -XX:MaxPermSize=160m -Xbootclasspath/p:/usr/local/openjdk7/langtools/dist/bootstrap/lib/javac.jar -jar /usr/local/openjdk7/langtools/dist/bootstrap/lib/javac.jar  -g -source 7 -target 7 -encoding ascii -Xbootclasspath:/usr/local/openjdk7/classes 
  JAVAH_CMD = /usr/local/jdk1.6.0_45/bin/java -XX:-PrintVMOptions -XX:+UnlockDiagnosticVMOptions -XX:-LogVMOutput -Xmx512m -Xms512m -XX:PermSize=32m -XX:MaxPermSize=160m -Xbootclasspath/p:/usr/local/openjdk7/langtools/dist/bootstrap/lib/javah.jar:/usr/local/openjdk7/langtools/dist/bootstrap/lib/javac.jar -jar /usr/local/openjdk7/langtools/dist/bootstrap/lib/javah.jar -bootclasspath /usr/local/openjdk7/classes
  JAVADOC_CMD = /usr/local/jdk1.6.0_45/bin/java -XX:-PrintVMOptions -XX:+UnlockDiagnosticVMOptions -XX:-LogVMOutput -Xmx512m -Xms512m -XX:PermSize=32m -XX:MaxPermSize=160m -Xbootclasspath/p:/usr/local/openjdk7/langtools/dist/bootstrap/lib/javadoc.jar:/usr/local/openjdk7/langtools/dist/bootstrap/lib/javac.jar:/usr/local/openjdk7/langtools/dist/bootstrap/lib/doclets.jar -jar /usr/local/openjdk7/langtools/dist/bootstrap/lib/javadoc.jar -bootclasspath /usr/local/openjdk7/classes
 
Build Platform Settings:
  USER = root
  PLATFORM = linux
  ARCH = amd64
  LIBARCH = amd64
  ARCH_FAMILY = amd64
  ARCH_DATA_MODEL = 64
  ARCHPROP = amd64
  ALSA_VERSION = 1.1.0
  OS_VERSION = 2.6.32-696.16.1.el6.x86_64 [requires at least 2.6]
  OS_VARIANT_NAME = RedHat
  OS_VARIANT_VERSION = 
  MB_OF_MEMORY = 1861
 
GNU Make Settings:
  MAKE = make
  MAKE_VER = 3.81 [requires at least 3.81]
  MAKECMDGOALS = sanity
  MAKEFLAGS = w
  SHELL = /bin/sh
 
Target Build Versions:
  JDK_VERSION = 1.7.0
  MILESTONE = internal
  RELEASE = 1.7.0-internal-debug
  FULL_VERSION = 1.7.0-internal-debug-root_2018_05_01_00_10-b00
  BUILD_NUMBER = b00
 
External File/Binary Locations:
  USRJDKINSTANCES_PATH = /opt/java
  BUILD_JDK_IMPORT_PATH = /NOT-SET/re/jdk/1.7.0/promoted/latest/binaries
    ALT_BUILD_JDK_IMPORT_PATH = 
  JDK_IMPORT_PATH = /usr/local/jdk1.6.0_45
    ALT_JDK_IMPORT_PATH = /usr/local/jdk1.6.0_45
  LANGTOOLS_DIST = /usr/local/openjdk7/langtools/dist
    ALT_LANGTOOLS_DIST = /usr/local/openjdk7/langtools/dist
  CORBA_DIST = /usr/local/openjdk7/corba/dist
    ALT_CORBA_DIST = /usr/local/openjdk7/corba/dist
  JAXP_DIST = /usr/local/openjdk7/jaxp/dist
    ALT_JAXP_DIST = /usr/local/openjdk7/jaxp/dist
  JAXWS_DIST = /usr/local/openjdk7/jaxws/dist
    ALT_JAXWS_DIST = /usr/local/openjdk7/jaxws/dist
  HOTSPOT_DOCS_IMPORT_PATH = /usr/local/openjdk7/hotspot/import/docs
    ALT_HOTSPOT_DOCS_IMPORT_PATH = 
  HOTSPOT_IMPORT_PATH = /usr/local/openjdk7/hotspot/import
    ALT_HOTSPOT_IMPORT_PATH = /usr/local/openjdk7/hotspot/import
  HOTSPOT_SERVER_PATH = /usr/local/openjdk7/hotspot/import/jre/lib/amd64/server
    ALT_HOTSPOT_SERVER_PATH = 
  CACERTS_FILE = ./../src/share/lib/security/cacerts
    ALT_CACERTS_FILE = 
  CUPS_HEADERS_PATH = /usr/include
    ALT_CUPS_HEADERS_PATH = 
 
OpenJDK-specific settings:
  FREETYPE_HEADERS_PATH = /usr/local/include/freetype2
    ALT_FREETYPE_HEADERS_PATH = /usr/local/include/freetype2
  FREETYPE_LIB_PATH = /usr/local/lib
    ALT_FREETYPE_LIB_PATH = /usr/local/lib
 
Previous JDK Settings:
  PREVIOUS_RELEASE_PATH = USING-PREVIOUS_RELEASE_IMAGE
    ALT_PREVIOUS_RELEASE_PATH = 
  PREVIOUS_JDK_VERSION = 1.6.0
    ALT_PREVIOUS_JDK_VERSION = 
  PREVIOUS_JDK_FILE = 
    ALT_PREVIOUS_JDK_FILE = 
  PREVIOUS_JRE_FILE = 
    ALT_PREVIOUS_JRE_FILE = 
  PREVIOUS_RELEASE_IMAGE = /usr/local/jdk1.6.0_45
    ALT_PREVIOUS_RELEASE_IMAGE = 


Sanity check passed.
View Code

 三、编译操作

   make 2>&1 | tee $ALT_OUTPUTDIR/build.log  # 编译,标准错误输出stderr重定向到标准输出stdout,将编译过程数据重定向到文件保存。

  若编译失败,重新编译前先执行:make clean

  若编译成功,提示信息如下:

-- Build times ----------
Target debug_build
Start 2018-04-30 23:30:30
End 2018-04-30 23:45:05
00:01:45 corba
00:03:32 hotspot
00:00:18 jaxp
00:00:24 jaxws
00:08:05 jdk
00:00:31 langtools
00:14:35 TOTAL
-------------------------

四、验证

  进入/usr/local/openjdk7/bin(即$ALT_OUTPUTDIR/bin)目录,执行:./java -version

[root@dsp-centos-1-6_9 bin]# ./java -version
openjdk version "1.7.0-internal-debug"
OpenJDK Runtime Environment (build 1.7.0-internal-debug-root_2018_04_30_20_26-b00)
OpenJDK 64-Bit Server VM (build 21.0-b17-jvmg, mixed mode)

  验证虚拟机

---------------------------------------------------------------------------------
# 将env.sh中的环境变量单独拎出来执行下,笔者直接执行env.sh没效果
# export JAVA_HOME=/usr/local/jdk1.6.0_45
# export LD_LIBRARY_PATH=.:${JAVA_HOME}/jre/lib/amd64/native_threads:${JAVA_HOME}/jre/lib/amd64:
# export CLASSPATH=.:${JAVA_HOME}/jre/lib/rt.jar:${JAVA_HOME}/jre/lib/i18n.jar
# export HOTSPOT_BUILD_USER="root in hotspot"

[root@dsp-centos-1-6_9 jvmg]# export JAVA_HOME=/usr/local/jdk1.6.0_45
[root@dsp-centos-1-6_9 jvmg]# echo $JAVA_HOME # 确认下是否符合预期
/usr/local/jdk1.6.0_45
[root@dsp-centos-1-6_9 jvmg]# export LD_LIBRARY_PATH=.:${JAVA_HOME}/jre/lib/amd64/native_threads:${JAVA_HOME}/jre/lib/amd64:
[root@dsp-centos-1-6_9 jvmg]# echo $LD_LIBRARY_PATH
.:/usr/local/jdk1.6.0_45/jre/lib/amd64/native_threads:/usr/local/jdk1.6.0_45/jre/lib/amd64:
[root@dsp-centos-1-6_9 jvmg]# export CLASSPATH=.:${JAVA_HOME}/jre/lib/rt.jar:${JAVA_HOME}/jre/lib/i18n.jar
[root@dsp-centos-1-6_9 jvmg]# echo $CLASSPATH
.:/usr/local/jdk1.6.0_45/jre/lib/rt.jar:/usr/local/jdk1.6.0_45/jre/lib/i18n.jar
[root@dsp-centos-1-6_9 jvmg]# export HOTSPOT_BUILD_USER="root in hotspot"
[root@dsp-centos-1-6_9 jvmg]# echo $HOTSPOT_BUILD_USER
root in hotspot
---------------------------------------------------------------------------------
[root@dsp-centos-1-6_9 jvmg]# ./gamma -version
Using java runtime at: /usr/local/jdk1.6.0_45/jre
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
OpenJDK 64-Bit Server VM (build 21.0-b17-jvmg, mixed mode)
---------------------------------------------------------------------------------
[root@dsp-centos-1-6_9 jvmg]# ./test_gamma   # 解八皇后问题
java full version "1.6.0_45-b06"
Using java runtime at: /usr/local/jdk1.6.0_45/jre
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
OpenJDK 64-Bit Server VM (build 21.0-b17-jvmg, mixed mode)

1. A1 B5 C8 D6 E3 F7 G2 H4 
2. A1 B6 C8 D3 E7 F4 G2 H5 
3. A1 B7 C4 D6 E8 F2 G5 H3 
4. A1 B7 C5 D8 E2 F4 G6 H3 
5. A2 B4 C6 D8 E3 F1 G7 H5 
6. A2 B5 C7 D1 E3 F8 G6 H4 
7. A2 B5 C7 D4 E1 F8 G6 H3 
8. A2 B6 C1 D7 E4 F8 G3 H5 
9. A2 B6 C8 D3 E1 F4 G7 H5 
10. A2 B7 C3 D6 E8 F5 G1 H4 
11. A2 B7 C5 D8 E1 F4 G6 H3 
12. A2 B8 C6 D1 E3 F5 G7 H4 
13. A3 B1 C7 D5 E8 F2 G4 H6 
14. A3 B5 C2 D8 E1 F7 G4 H6 
15. A3 B5 C2 D8 E6 F4 G7 H1 
16. A3 B5 C7 D1 E4 F2 G8 H6 
17. A3 B5 C8 D4 E1 F7 G2 H6 
18. A3 B6 C2 D5 E8 F1 G7 H4 
19. A3 B6 C2 D7 E1 F4 G8 H5 
20. A3 B6 C2 D7 E5 F1 G8 H4 
21. A3 B6 C4 D1 E8 F5 G7 H2 
22. A3 B6 C4 D2 E8 F5 G7 H1 
23. A3 B6 C8 D1 E4 F7 G5 H2 
24. A3 B6 C8 D1 E5 F7 G2 H4 
25. A3 B6 C8 D2 E4 F1 G7 H5 
26. A3 B7 C2 D8 E5 F1 G4 H6 
27. A3 B7 C2 D8 E6 F4 G1 H5 
28. A3 B8 C4 D7 E1 F6 G2 H5 
29. A4 B1 C5 D8 E2 F7 G3 H6 
30. A4 B1 C5 D8 E6 F3 G7 H2 
31. A4 B2 C5 D8 E6 F1 G3 H7 
32. A4 B2 C7 D3 E6 F8 G1 H5 
33. A4 B2 C7 D3 E6 F8 G5 H1 
34. A4 B2 C7 D5 E1 F8 G6 H3 
35. A4 B2 C8 D5 E7 F1 G3 H6 
36. A4 B2 C8 D6 E1 F3 G5 H7 
37. A4 B6 C1 D5 E2 F8 G3 H7 
38. A4 B6 C8 D2 E7 F1 G3 H5 
39. A4 B6 C8 D3 E1 F7 G5 H2 
40. A4 B7 C1 D8 E5 F2 G6 H3 
41. A4 B7 C3 D8 E2 F5 G1 H6 
42. A4 B7 C5 D2 E6 F1 G3 H8 
43. A4 B7 C5 D3 E1 F6 G8 H2 
44. A4 B8 C1 D3 E6 F2 G7 H5 
45. A4 B8 C1 D5 E7 F2 G6 H3 
46. A4 B8 C5 D3 E1 F7 G2 H6 
47. A5 B1 C4 D6 E8 F2 G7 H3 
48. A5 B1 C8 D4 E2 F7 G3 H6 
49. A5 B1 C8 D6 E3 F7 G2 H4 
50. A5 B2 C4 D6 E8 F3 G1 H7 
51. A5 B2 C4 D7 E3 F8 G6 H1 
52. A5 B2 C6 D1 E7 F4 G8 H3 
53. A5 B2 C8 D1 E4 F7 G3 H6 
54. A5 B3 C1 D6 E8 F2 G4 H7 
55. A5 B3 C1 D7 E2 F8 G6 H4 
56. A5 B3 C8 D4 E7 F1 G6 H2 
57. A5 B7 C1 D3 E8 F6 G4 H2 
58. A5 B7 C1 D4 E2 F8 G6 H3 
59. A5 B7 C2 D4 E8 F1 G3 H6 
60. A5 B7 C2 D6 E3 F1 G4 H8 
61. A5 B7 C2 D6 E3 F1 G8 H4 
62. A5 B7 C4 D1 E3 F8 G6 H2 
63. A5 B8 C4 D1 E3 F6 G2 H7 
64. A5 B8 C4 D1 E7 F2 G6 H3 
65. A6 B1 C5 D2 E8 F3 G7 H4 
66. A6 B2 C7 D1 E3 F5 G8 H4 
67. A6 B2 C7 D1 E4 F8 G5 H3 
68. A6 B3 C1 D7 E5 F8 G2 H4 
69. A6 B3 C1 D8 E4 F2 G7 H5 
70. A6 B3 C1 D8 E5 F2 G4 H7 
71. A6 B3 C5 D7 E1 F4 G2 H8 
72. A6 B3 C5 D8 E1 F4 G2 H7 
73. A6 B3 C7 D2 E4 F8 G1 H5 
74. A6 B3 C7 D2 E8 F5 G1 H4 
75. A6 B3 C7 D4 E1 F8 G2 H5 
76. A6 B4 C1 D5 E8 F2 G7 H3 
77. A6 B4 C2 D8 E5 F7 G1 H3 
78. A6 B4 C7 D1 E3 F5 G2 H8 
79. A6 B4 C7 D1 E8 F2 G5 H3 
80. A6 B8 C2 D4 E1 F7 G5 H3 
81. A7 B1 C3 D8 E6 F4 G2 H5 
82. A7 B2 C4 D1 E8 F5 G3 H6 
83. A7 B2 C6 D3 E1 F4 G8 H5 
84. A7 B3 C1 D6 E8 F5 G2 H4 
85. A7 B3 C8 D2 E5 F1 G6 H4 
86. A7 B4 C2 D5 E8 F1 G3 H6 
87. A7 B4 C2 D8 E6 F1 G3 H5 
88. A7 B5 C3 D1 E6 F8 G2 H4 
89. A8 B2 C4 D1 E7 F5 G3 H6 
90. A8 B2 C5 D3 E1 F7 G4 H6 
91. A8 B3 C1 D6 E2 F5 G7 H4 
92. A8 B4 C1 D3 E6 F2 G7 H5 
[root@dsp-centos-1-6_9 jvmg]#

 五、笔者碰到的问题

  1、java.lang.RuntimeException: time is more than 10 years from present

    修改jdk/src/share/classes/java/util/CurrencyData.properties,将日期改为十年以内,JDK的Bug。

  108行改为: AZ=AZM;2009-12-31-20-00-00;AZN,接下来的377、439、529、555行类似修改保存,重新编译。

2、/usr/local/openjdk7-debug/jaxws/build/xml_generated/build-drop-jaf_src.xml:96: Redirection detected from https to http. Protocol switch unsafe, not allowed.

  原因是jdk7-jaf-2010_08_19.zip这个包下载不了导致的,解决方案:

将以下三个文件下载后置于OpenJDK解压后根目录下的drop目录下,

并在环境变量中加入配置:export ALT_DROPS_DIR=/usr/local/src/openjdk7/drop # 注意目录Path

jdk7-jaf-2010_08_19.zip,下载地址:https://netix.dl.sourceforge.net/project/jdk7src/input-archives/jdk7-jaf-2010_08_19.zip

jdk7-jaxws2_2_4-b03-2011_05_27.zip,下载地址:http://download.java.net/glassfish/components/jax-ws/openjdk/jdk7/jdk7-jaxws2_2_4-b03-2011_05_27.zip

jaxp145_01.zip,下载地址:http://download.java.net/jaxp/1.4.5/jaxp145_01.zip

以下是操作过程的命令:

mkdir /usr/local/src/openjdk7/drop
export ALT_DROPS_DIR=/usr/local/src/openjdk7/drop
cd /usr/local/src/openjdk7/drop
wget http://download.java.net/jaxp/1.4.5/jaxp145_01.zip
wget https://netix.dl.sourceforge.net/project/jdk7src/input-archives/jdk7-jaf-2010_08_19.zip
wget http://download.java.net/glassfish/components/jax-ws/openjdk/jdk7/jdk7-jaxws2_2_4-b03-2011_05_27.zip

六、参考资料:

  《深入理解Java虚拟机:JVM高级特性与最佳实践》

  [深入理解Java虚拟机]第一章实战 自己编译JDK

  ubuntu13 编译openjdk7的问题并解决

  java-编译openJdk

  openjdk7 源码下载

JDK源码下载

OpenJDK8 Windows编译

posted @ 2018-05-01 02:35  dai.sp  阅读(1028)  评论(0编辑  收藏  举报