Compile OpenJDK7 in Ubuntu11.10

Source: Internet
Author: User
1. first go to the terminal (sudoapt-getinstallaptitude) sudoaptitudebuild-depopenjdk-63. Note: Ubuntu system language is required 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 notAptitude, first installAptitude(Sudo apt-get install aptitude)
Sudo aptitude build-dep openjdk-6

3. Note:: Ubuntu SystemLanguageRequiredSwitchToEnglish(SystemSet->LanguageSupported)
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:
  1. Check_ OS _version:
  2. # Ifeq ($ (DISABLE_HOTSPOT_ OS _VERSION_CHECK) $ (EMPTY_IF_NOT_SUPPORTED ),)
  3. # $ (QUIETLY)> & 2 echo "*** This OS is not supported:" 'uname-a'; exit 1;
  4. # Endif
5. Modify jdk/make/javax/sound/jsoundalsa/ Makefile file under
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.
  1. #! /Bin/bash
  2. Export LANG = C
  3. Export ALT_BOOTDIR =/usr/lib/jvm/java-6-openjdk
  4. Export ALLOW_DOWNLOADS = true
  5. Export USE_PRECOMPILED_HEADER = true
  6. Export SKIP_DEBUG_BUILD = false
  7. Export SKIP_FASTDEBUG_BUILD = true
  8. Export DEBUG_NAME = debug
  9. Unset CLASSPATH
  10. Unset JAVA_HOME
  11. Make sanity & make
7. Execute the compilation script./buildjdk. sh
8. Check the result after compilation is completed.
  1. -- Build times ----------
  2. Target debug_build
  3. Start 2012-02-24 21:44:33
  4. End 22:40:32
  5. 00:00:52 corba
  6. 00:23:09 hotspot
  7. 00:09:25 jaxp
  8. 00:08:38 jaxws
  9. 00:13:01 jdk
  10. 00:00:54 langtools
  11. 00:55:59 TOTAL
  12. -------------------------
  13. Make [1]: Leaving directory '/home/nathan/study/openjdk'
  14. Nathan @ ubuntu :~ /Study/openjdk $ build/linux-i586-debug/j2sdk-image/bin/java-version
  15. Openjdk version "1.7.0-internal-debug"
  16. OpenJDK Runtime Environment (build 1.7.0-internal-debug-nathan_2012_02_24_20_17-b00)
  17. OpenJDK Server VM (build 21.0-b17-jvmg, mixed mode)
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.