Home Operation and Maintenance Linux Operation and Maintenance Detailed steps for compiling JDK in Linux environment

Detailed steps for compiling JDK in Linux environment

Mar 12, 2019 pm 03:29 PM
jdk

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

  1. 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.
  2. 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.zip
  3. Bootstrap 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 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 ant
Copy after login

2. Unzip Open JDK.

unzip openjdk-7u75-src-b13-18_dec_2014.zip
Copy after login

3. Install Bootstrap JDK.

./jdk-6u45-linux-x64.bin
Copy after login

4. Create a new shell script in the Open JDK directory: build.sh, /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
Copy after login

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. 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;VEF
Copy after login

6. Execute the compilation script

#cd <OpenJDK源码目录>cd /home/javon/jdk/openjdk/sh build.sh
Copy after login

7. After the compilation is completed, the following directory will be obtained under the ALT_OUTPUTDIR path,


. Among them, the j2sdk-image directory stores the complete compilation result of the entire JDK. We enter the entire directory and type "java -version", and we will get the following results:

Problems encountered during the compilation process

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% 3% and then add 4%. The modified content is:

SUPPORTED_OS_VERSION = 2.4% 2.5% 2.6% 3% 4%
Copy after login

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!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to install Java on Windows 11 How to install Java on Windows 11 Apr 13, 2023 pm 09:22 PM

Despite the large number of applications that appear every once in a while, Java remains by far one of the most used and important programming languages. Many applications rely on Java on Windows operating systems, and updating it means improving performance by providing stability and security for Java applications to run safely. You can also install Java on Linux and macOS platforms. The only difference is the package/file for each platform. Now, with Windows 11, it’s time to download Java and in today’s article, we will take you through the simple steps to install it on your device. Which version of Java should I download? The Java version you downloaded

Does oracle database require jdk? Does oracle database require jdk? Jun 05, 2023 pm 05:06 PM

The oracle database requires jdk. The reasons are: 1. When using specific software or functions, other software or libraries included in the JDK are required; 2. Java JDK needs to be installed to run Java programs in the Oracle database; 3. JDK provides Develop and compile Java application functions; 4. Meet Oracle's requirements for Java functions to help implement and implement specific functions.

Analysis of JDK dynamic proxy examples in java Analysis of JDK dynamic proxy examples in java Apr 30, 2023 pm 01:16 PM

1. Explain that Java provides a dynamic proxy class Proxy. Proxy is not the class of what we call proxy objects, but provides a static method (newProxyInstance) to create proxy objects to obtain proxy objects. 2. Instance publicclassHelloWorld{publicstaticvoidmain(String[]args){//Get the proxy object ProxyFactoryfactory=newProxyFactory();SellTicketsproxyObject=factory.getProxyObject();proxyO

Deepin Linux system installation JDK tutorial Deepin Linux system installation JDK tutorial Feb 15, 2024 pm 12:36 PM

Deepin Linux system is a domestic operating system based on the Linux kernel. It has the characteristics of stability, security, and ease of use. In Deepin Linux system, installing JDK (Java Development Kit) is a necessary step for developing Java applications. This article will introduce in detail how to Install JDK in Deepin Linux system. Installation steps: Open the terminal of Deepin Linux system. Use the command line to download the JDK installation package. The command is as follows: ``shellsudoapt-getinstallopenjdk-11-jdk`` Wait for the download to complete and the system will automatically install the JDK. To verify whether the JDK is installed successfully, enter the following command: ```javaj

Where is the linux jdk directory? Where is the linux jdk directory? Mar 22, 2023 am 09:52 AM

The linux jdk directory is in the bin directory. The specific search method is: 1. Find the execution directory of javad through the "whereis java" command; 2. Find the link file through the execution file; 3. Through "ls -lrt /etc/alternatives/java" Just run the command to find the installation directory.

How to install jdk-jdk installation tutorial How to install jdk-jdk installation tutorial Mar 04, 2024 pm 05:10 PM

Recently, many friends have asked me how to install jdk. Next, let us learn all about how to install jdk. I hope it can help everyone. 1. First download the JDK installation file and enter the JDK installation interface, as shown in the figure. 2. Click the "Next" button to enter the JDK custom installation interface, as shown in the figure. 3. It is recommended to choose to install directly to the default directory and click the "Next" button to install, as shown in the figure. You can also click the "Change" button to select the installation directory yourself. 4. After the installation is completed, the interface will pop up and click the "Close" button, as shown in the figure. The above is all the tutorials on how to install jdk brought by the editor. I hope it can be helpful to everyone.

How to specify springboot external configuration file in multi-jdk environment How to specify springboot external configuration file in multi-jdk environment May 11, 2023 pm 04:01 PM

Problem description: When there are multiple jdk in the deployment environment, and the default jdk version is lower than jdk8. When we deploy springboot applications, we need to specify jdk as jdk8 or above. A problem will arise: the external configuration file of the springboot application cannot be loaded, and it will always use the default configuration file imported into the application jar. Problem Solving There are two ways to solve this problem, as follows: Add startup parameters --spring.config.additional-locationnohup/home/jdk1.8.0_251/bin/java-Xms256m-Xmx256m-j

How to configure the jdk environment in Linux system How to configure the jdk environment in Linux system May 12, 2023 am 09:31 AM

The following steps are to deploy the jdk environment in the Linux system 1. Download the jdk installation package 2. Create a new installation jdk folder (/usr/local/java/jdk) cd /usr/localmkdir/usr/local/javalocal directory and create a new java directory cd /usr/local/javamkdir/usr/local/java/jdk Create a new jdk directory cd/usr/local/java/jdk3. Upload the jdk installation package to linux4. Unzip the jdk installation package. Decompression format: The name after the tarzxvf compressed package name can be just Enter an initial letter and use the Tab key

See all articles