In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Know how to compile JDK in Linux environment? This problem may be often seen in our daily study or work. I hope you can gain a lot from this question. The following is the reference content that the editor brings to you, let's take a look at it!
Environmental preparation
Operating system, ubuntu-14.04.6-desktop-amd64.iso, download address: http://59.80.44.100/releases.ubuntu.com/14.04/ubuntu-14.04.6-desktop-amd64.iso. Open JDK source code, openjdk-7u75-src-b13-18_dec_2014.zip, download address: https://download.java.net/openjdk/jdk7u75/ri/openjdk-7u75-src-b13-18_dec_2014.zipBootstrap JDK, use Oracle JDK:jdk-6u45-linux-x64.bin, download address: https://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase6-419409.html
Compilation step
1. Install the JDK compilation dependency 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 ant
two。 Extract the Open JDK.
Unzip openjdk-7u75-src-b13-18_dec_2014.zip
3. Install Bootstrap JDK.
. / jdk-6u45-linux-x64.bin
4. Create a new shell script: build.sh,/build.sh under the Open JDK directory. The script content is as follows:
#! / bin/bash export LANG=C export ALT_BOOTDIR=/home/javon/jdk/jdk1.6.0_45# allows automatic download of dependency packages export ALLOW_DOWNLOADS=true# using precompiled header files To speed up export USE_PRECOMPILED_HEADER=true# the content to be compiled export BUILD_LANGTOOLS=true export BUILD_JAXP=true export BUILD_JAXWS=true export BUILD_CORBA=true export BUILD_HOSTPOT=true export BUILD_JDK=true# the version to be compiled export SKIP_DEBUG_BUILD=false export SKIP_FASTDEBUG_BUILD=true export DEBUG_NAME=debug# avoid javaws and browser Java plug-ins such as build BUILD_DEPLOY=false# do not build installation package BUILD_INSTALL=false# sets the directory export ALT_OUTPUTDIR=/home/javon/jdk/openjdk-7- where the compilation results are stored Src/buildunset 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, / jdk/src/share/classes/java/util/CurrencyData.properties, to change the following time in the file to one within 10 years:
AZ=AZM;2015-12-31-20-00-00 investors AZNMZ-MZM countries 2016-06-30-22-00-00 MZNROWTH Rolls, 2015-06-30-21-00-00 TRANTRIMETS TRLTRACT2014-12-31-22-00-00THANTYVEVEBRACT2018-01-01-04-00-00TERVEFs
6. Execute the compilation script
# cd cd / home/javon/jdk/openjdk/sh build.sh
7. After the compilation is completed, you will get the following directory under the ALT_OUTPUTDIR path
Among them, the complete compilation result of the whole JDK is stored in the j2sdk-image directory. We enter the entire directory, type "java-version", and get the following result:
Problems encountered in the process of compilation
1. The operating system version is not supported, This OS is not supported.
Solution: modify the file / hotspot/make/linux/MakeFile,SUPPORTED_OS_VERSION = 2.4%, 2.5%, 2.6%, then add 4%, and the modified content is as follows:
SUPPORTED_OS_VERSION = 2.4% 2.5% 2.6% 2.6% 4% Thank you for your reading! After reading the above, do you have a general idea of how to compile JDK in Linux environment? I hope the content of the article will be helpful to all of you. If you want to know more about the relevant articles, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.