Copyright statement: welcome to reprint, please indicate the source, thank you. https://blog.csdn.net/boling_cavalry/article/details/83303317
The above is the file path on my side, if you are inconsistent with mine, it doesn’t matter, please pay attention to modify it to your own corresponding;
mkdir /usr/lib/jvm/jdk-10/jre && cp -r /usr/lib/jvm/jdk-10/lib /usr/lib/jvm/jdk-10/jre/
chown -R root jdk11 && chgrp -R root jdk11
apt-get install -y autoconf zip libx11-dev libxext-dev libxrender-dev libxtst-dev libxt-dev libcups2-dev libfontconfig1-dev libasound2-dev
bash configure --with-num-cores=4--with-memory-size=8192
In the above command, –with-num-cores=4 means quad-core CPU participates in compilation, –with-memory-size=8192 means 8G memory participates in compilation, please adjust according to the actual configuration of your computer;
If the configuration fails, there will be related prompts, please make adjustments according to the prompt content. The applications installed in step 3 are actually prompted to be installed when the configuration check fails;
====================================================
A newconfiguration has been successfully created in/home/willzhao/work/compileopenjdk/jdk11/build/linux-x86_64-normal-server-release
using configure arguments '--with-num-cores=4 --with-memory-size=8192'.
Configuration summary:* Debug level: release
* HS debug level: product
* JVM variants: server
* JVM features: server:'aot cds cmsgc compiler1 compiler2 epsilongc g1gc graal jfr jni-check jvmci jvmti management nmt parallelgc serialgc services vm-structs'* OpenJDK target: OS: linux, CPU architecture: x86, address length:64* Version string:11-internal+0-adhoc.root.jdk11(11-internal)
Tools summary:* Boot JDK: openjdk version "10"2018-03-20 OpenJDK Runtime Environment 18.3(build 10+44) OpenJDK 64-Bit Server VM 18.3(build 10+44, mixed mode)(at /usr/lib/jvm/jdk-10)* Toolchain:gcc(GNU Compiler Collection)* C Compiler: Version 5.4.0(at /usr/bin/gcc)* C++ Compiler: Version 5.4.0(at /usr/bin/g++)
Build performance summary:* Cores to use:4* Memory limit:8192 MB
Creating support/modules_cmds/jdk.pack/pack200 from1file(s)
Creating support/modules_cmds/jdk.pack/unpack200 from7file(s)
Creating support/modules_cmds/jdk.rmic/rmic from1file(s)
Creating support/modules_cmds/jdk.scripting.nashorn.shell/jjs from1file(s)
Creating support/modules_libs/jdk.sctp/libsctp.so from3file(s)
Creating support/modules_libs/jdk.security.auth/libjaas.so from1file(s)
Compiling 4 files for BUILD_JIGSAW_TOOLS
Stopping sjavac server
Finished building target 'default (exploded-image)'in configuration 'linux-x86_64-normal-server-release'
Creating support/modules_cmds/jdk.pack/unpack200 from7file(s)
Creating support/modules_cmds/jdk.rmic/rmic from1file(s)
Creating support/modules_cmds/jdk.scripting.nashorn.shell/jjs from1file(s)
Creating support/modules_libs/jdk.sctp/libsctp.so from3file(s)
Creating support/modules_libs/jdk.security.auth/libjaas.so from1file(s)
Compiling 4 files for BUILD_JIGSAW_TOOLS
- - - - - Build times -------
Start 2018-10-2314:45:20
End 2018-10-2314:53:5300:08:33 TOTAL
-------------------------
Finished building target 'default (exploded-image)'in configuration 'linux-x86_64-normal-server-release'
root@willzhao-Lenovo-Ubuntu16:/home/willzhao/work/compileopenjdk/jdk11/build/linux-x86_64-normal-server-release/jdk/bin# ./java -version
openjdk version "11-internal"2018-09-25
OpenJDK Runtime Environment(build 11-internal+0-adhoc.root.jdk11)
OpenJDK 64-Bit Server VM(build 11-internal+0-adhoc.root.jdk11, mixed mode)
At this point, the compilation and construction based on the OpenJDK11 source code has been successful, and the new JDK can be used normally by setting the environment variables in the /etc/profile file;
Recommended Posts