Compile and install openjdk in CentOS5.5

Source: Internet
Author: User

Compile and install openjdk in CentOS5.5

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
Wgethttp: // response

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

Unzipapache-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 can: unzipopenjdk-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.