第1章 走近Java
文章目录
1.6 实战:自己编译JDK
1.6.1 获取源码
下载 -> browse -> zip
1.6.3 构建编译环境(Ubuntu)
工具 | 命令 |
---|---|
GCC | sudo apt-get install build-essential |
FreeType | sudo apt-get install libfreetype6-dev |
CUPS | sudo apt-get install libcups2-dev |
X11 | sudo apt-get install libx11-dev libxext-dev libxrender-dev libxrandr-dev libxtst-dev libxt-dev |
ALSA | sudo apt-get install libasound2-dev |
libffi | sudo apt-get install libffi-dev |
Autoconf | sudo apt-get install autoconf |
openjdk-11 | sudo apt-get install openjdk-11-jdk |
zip | sudo apt-get install zip |
libfontconfig | sudo apt-get install libfontconfig1-dev |
切换gcc
|
|
切换g++
|
|
1.6.4 进行编译
常用配置(bash configure --help
)
--with-debug-level=<level>
:编译级别(release, fastdebug, slowdebug),越往后优化少调试信息多--enable-debug
:等效于--with-debug-level=fastdebug
--with-native-debug-symbols=<method>
:确定调试符号信息的编译方式(none, internal, external, zipped)--with-version-string=<string>
:设置编译jdk版本号
编译配置bash configure --enable-debug --with-jvm-variants=server
编译make images
检查build/配置名称/jdk/bin/java -version