gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36)
gcc我用的188上的4.8,若是用189 機器上的gcc 7 會編譯報錯html
cd /root/yuyi/jdk8-b120/jdk-a1ee9743f4ee chmod +x configure yum install libXtst-devel libXt-devel libXrender-devel yum install cups-devel yum install freetype-devel yum install alsa-lib-devel # 沒有javac的話要裝一個 此步驟可選 主要是要javac在 yum install java-1.8.0-openjdk-devel ./configure --with-debug-level=slowdebug
配置成功的話結果以下:java
A new configuration has been successfully created in /root/yuyi/jdk8-b120-a1ee9743f4ee/jdk-a1ee9743f4ee/build/linux-x86_64-normal-server-slowdebug using configure arguments '--with-debug-level=slowdebug'. Configuration summary: * Debug level: slowdebug * JDK variant: normal * JVM variants: server * OpenJDK target: OS: linux, CPU architecture: x86, address length: 64 Tools summary: * Boot JDK: openjdk version "1.8.0_212" OpenJDK Runtime Environment (build 1.8.0_212-b04) OpenJDK 64-Bit Server VM (build 25.212-b04, mixed mode) (at /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.212.b04-0.el7_6.x86_64) * C Compiler: gcc (GCC) 4.8.5 20150623 (Red Hat-36) version 4.8.5-36) (at /usr/bin/gcc) * C++ Compiler: g++ (GCC) 4.8.5 20150623 (Red Hat-36) version 4.8.5-36) (at /usr/bin/g++) Build performance summary: * Cores to use: 10 * Memory limit: 15836 MB * ccache status: not installed (consider installing) Build performance tip: ccache gives a tremendous speedup for C++ recompilations. You do not have ccache installed. Try installing it. You might be able to fix this by running 'sudo yum install ccache'.```
開始編譯:linux
nohup make all & tail -f nohup.out # 忽略 exception in thread "main" java.lang.VerifyError: class jdk.nashorn... [root@ceph2:/root/yuyi/jdk8-b120-a1ee9743f4ee/jdk-a1ee9743f4ee/build/linux-x86_64-normal-server-slowdebug/jdk/bin] # ./java -version openjdk version "1.8.0-internal-debug" OpenJDK Runtime Environment (build 1.8.0-internal-debug-root_2019_06_23_21_36-b00) OpenJDK 64-Bit Server VM (build 25.0-b62-debug, mixed mode)
解壓調試符號包並調試:shell
export args='-Xmx50m -XX:+UseSerialGC -XX:+PrintCommandLineFlags -verbose:gc -XX:+PrintGC -XX:+PrintGCDateStamps -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -Xloggc:/root/yuyi/temp/gclog/UseSerialGC.log' cd /root/yuyi/jdk8-b120-a1ee9743f4ee/jdk-a1ee9743f4ee/build/linux-x86_64-normal-server-slowdebug/jdk/lib/amd64/server unzip libjvm.diz # debug GCTest1: cd /root/yuyi/jdk8-b120-a1ee9743f4ee/jdk-a1ee9743f4ee/build/linux-x86_64-normal-server-slowdebug/jdk/bin gdb --args ./java $args -cp ./ GCTest1
我後來在我本身虛擬機上也能編譯經過。我本身虛擬機ubuntu desktop18。配合CDT使用,爽的飛起。ubuntu