Compile openjdk7 in ubuntu11.10

Source: Internet
Author: User
1. first go to the http://download.java.net/openjdk/jdk7/ to download the openjdk7 source code zip package

 
2. Install the compilation Toolkit
If aptitude is not installed, install Aptitude (SUDO
Apt-Get install aptitude)
Sudo aptitude build-dep openjdk-6

3. Note: the language of the Ubuntu system must be switched to English (system settings-> language support)
4. Modify the MAKEFILE file in hotspot/make/Linux and comment out the following content. If no comment is made, an error is returned, and Exit 1 to exit Compilation:
check_os_version:#ifeq ($(DISABLE_HOTSPOT_OS_VERSION_CHECK)$(EMPTY_IF_NOT_SUPPORTED),)#$(QUIETLY) >&2 echo "*** This OS is not supported:" `uname -a`; exit 1;#endif

5. Modify the MAKEFILE file under JDK/make/javax/sound/jsoundalsa/and set

LDFLAGS += -lasound

Change
Extra_libs + =-lasound
Otherwise, the compilation fails.

6. Prepare the compilation Script: buildjdk. SH and place it in the root directory of openjdk source code.
 

#!/bin/bashexport LANG=Cexport ALT_BOOTDIR=/usr/lib/jvm/java-6-openjdkexport ALLOW_DOWNLOADS=trueexport USE_PRECOMPILED_HEADER=trueexport SKIP_DEBUG_BUILD=falseexport SKIP_FASTDEBUG_BUILD=trueexport DEBUG_NAME=debugunset CLASSPATHunset JAVA_HOME         make sanity  && make

7. Execute the compilation script./buildjdk. Sh
8. Check the result after compilation is completed.

-- Build times ----------Target debug_buildStart 2012-02-24 21:44:33End   2012-02-24 22:40:3200:00:52 corba00:23:09 hotspot00:09:25 jaxp00:08:38 jaxws00:13:01 jdk00:00:54 langtools00:55:59 TOTAL-------------------------make[1]: Leaving directory `/home/nathan/study/openjdk'nathan@ubuntu:~/study/openjdk$ build/linux-i586-debug/j2sdk-image/bin/java -versionopenjdk version "1.7.0-internal-debug"OpenJDK Runtime Environment (build 1.7.0-internal-debug-nathan_2012_02_24_20_17-b00)OpenJDK Server VM (build 21.0-b17-jvmg, mixed mode)


 

Refrence:

1: http://www.85java.com/viewthread.php? Tid = 20878

2. http://stackoverflow.com/questions/9048254/how-to-compile-an-openjdk-7-debug-build-on-ubuntu-11-10

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.