Compile and install openjdk in CentOS5.5

Source: Internet
Author: User
1. uninstall the original jdk rpm-qa | grepjavayum-yremoveXXXX -- XXXX is the jdk information found by the first command. 2. you can install yum-yinstallalsa-lib-develyum-yinstallcups through yum. -develyum-yin

1. uninstall the original jdk of the system

Rpm-qa | grep java

Yum-y remove XXXX -- XXXX is the jdk information found by the first command.

II. the following dependency packages can be installed through yum

Yum-y install alsa-lib-devel
Yum-y install cups-devel
Yum-y install libXi-devel
Yum-y install gcc-c ++
Yum-y install libX *

3. install freetype-2.3.12
Wget http://sourceforge.net/projects/freetype/files/freetype2/2.3.12/freetype-2.3.12.tar.gz/download

Tar-xvf freetype-2.3.12.tar.gz

Cd freetype-2.3.12

./Configure & make install

# Note: if the following error occurs during installation

Rmdir/usr/local/include/freetype2/freetype/internal
Rmdir: failed to remove '/usr/local/include/freetype2/freetype/internal': No such file or directory
Make: [install] Error 1 (ignored)
/Usr/bin/install-c-m 644./builds/unix/ft2unix. h \
/Usr/local/include/ft2build. h
/Usr/bin/install-c-m 644./builds/unix/ftconfig. h \
/Usr/local/include/freetype2/freetype/config/ftconfig. h

Run the following command:

Mkdir-p/usr/local/include/freetype2/freetype/internal

Reinstall

./Configure & make install

 

4. install ant

The version used this time is: apache-ant-1.9.4-bin.zip

Unzip apache-ant-1.9.4-bin.zip

Ln-s decompressed ant directory/bin/ant/usr/bin/ant

 

5. install JDK and configure environment variables

The next compilation is openjdk-7-fcs-src-b147-27_jun_2011.zip, which requires jdk 6u14 or later. the JDK installation method is not written here.

6. download and decompress openjdk

The use of openjdk version: openjdk-7-fcs-src-b147-27_jun_2011.zip

After the download is complete decompress it: unzip openjdk-7-fcs-src-b147-27_jun_2011.zip

After decompression, an openjdk folder will be created.


7. check whether jdk is successfully installed.

Java-version: successful if the Echo contains the installed JDK details

Ant if the Echo contains build. xml does not exist! The installation is successful.

8. set environment variables before compilation

Unset CLASSPATH
Unset JAVA_HOME
Export LANG = C
Export ALT_BOOTDIR = the complete jdk installation directory, for example,/home/wyh/study/java/jdk.
Export ANT_HOME = complete ant installation path, for example,/home/wyh/study/apache-ant-1.9.4/
Export ALT_FREETYPE_LIB_PATH =/usr/local/lib
Export SKIP_DEBUG_BUILD = false
Export SKIP_FASTDEBUG_BUILD = true
Export DEBUG_NAME = debug
Export ALT_FREETYPE_HEADERS_PATH =/usr/local/include/freetype2

IX. Pre-compilation check

Switch to the decompressed openjdk path and execute: make sanity

If the following Echo is displayed, the check is successful:

........................................ ..........................

Previous JDK Settings:

Previus_release_path = USING-PREVIOUS_RELEASE_IMAGE

Alt_previus_release_path =

PREVIOUS_JDK_VERSION = 1.6.0

Alt_previus_jdk_version =

PREVIOUS_JDK_FILE =

Alt_previus_jdk_file =

PREVIOUS_JRE_FILE =

Alt_previus_jre_file =

PREVIOUS_RELEASE_IMAGE =/home/wyh/study/java/jdk

Alt_previus_release_image =

Sanity check passed.

 

10. Compile

Command: make all ARCH_DATA_MODEL = 64 ALLOW_DOWNLOADS = true, long time

If the following Echo is displayed, the compilation is complete:

 

11. test the self-compiled JDK

./Build/linux-amd64/bin/java-version

If the following Echo is displayed, the compilation is successful:

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.