Home > Article > Operation and Maintenance > Detailed steps for compiling JDK in Linux environment
The content of this article is about the detailed steps of compiling JDK in Linux environment. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.
Environment preparation
##Compilation steps
1. Install JDK compilation dependencies and execute the command:sudo apt-get install build-essential gawk m4 libasound2-dev libcups2-dev libxrender-dev xorg-dev xutils-dev x11proto-print-dev binutils libmotif3 libmotif-dev ant2. Unzip Open JDK.
unzip openjdk-7u75-src-b13-18_dec_2014.zip3. Install Bootstrap JDK.
./jdk-6u45-linux-x64.bin4. Create a new shell script in the Open JDK directory: build.sh, d573945737aa889c598e1fbb9059fea6/build.sh. The script content is as follows:
#!/bin/bash export LANG=C export ALT_BOOTDIR=/home/javon/jdk/jdk1.6.0_45 #允许自动下载依赖包 export ALLOW_DOWNLOADS=true#使用预编译头文件,以提升便以速度 export USE_PRECOMPILED_HEADER=true#要编译的内容 export BUILD_LANGTOOLS=true export BUILD_JAXP=true export BUILD_JAXWS=true export BUILD_CORBA=true export BUILD_HOSTPOT=true export BUILD_JDK=true#要编译的版本 export SKIP_DEBUG_BUILD=false export SKIP_FASTDEBUG_BUILD=true export DEBUG_NAME=debug #避免javaws和浏览器Java插件等的build BUILD_DEPLOY=false#不build安装包 BUILD_INSTALL=false#设置存放编译结果的目录 export ALT_OUTPUTDIR=/home/javon/jdk/openjdk-7-src/build unset CLASSPATH unset JAVA_HOME make sanity make 2>&1 | tee $ALT_OUTPUTDIR/build.log
Description: ALT_BOOTDIR is the Bootstrap JDK installation directory. 5. Modify a file in the Open JDK source code, d573945737aa889c598e1fbb9059fea6/jdk/src/share/classes/java/util/CurrencyData.properties. What you need to do is to change the following in the file Change the time to a time within 10 years:
AZ=AZM;2015-12-31-20-00-00;AZN MZ=MZM;2016-06-30-22-00-00;MZN RO=ROL;2015-06-30-21-00-00;RON TR=TRL;2014-12-31-22-00-00;TRY VE=VEB;2018-01-01-04-00-00;VEF6. Execute the compilation script
#cd <OpenJDK源码目录>cd /home/javon/jdk/openjdk/sh build.sh7. After the compilation is completed, the following directory will be obtained under the ALT_OUTPUTDIR path,
Problems encountered during the compilation process
1. The operating system version is not supported. This OS is not supported.
Modify the file d573945737aa889c598e1fbb9059fea6/hotspot/make/linux/MakeFile, SUPPORTED_OS_VERSION = 2.4% 2.5 % 2.6% 3% and then add 4%. The modified content is:
SUPPORTED_OS_VERSION = 2.4% 2.5% 2.6% 3% 4%
The above is the detailed content of Detailed steps for compiling JDK in Linux environment. For more information, please follow other related articles on the PHP Chinese website!