在上ubuntu11.10,下载和编译openJdk7源码

  • Install relevant packages:
sudo apt-get install ant build-essential openjdk-6-jdk
sudo apt-get build-dep openjdk-6-jdk
sudo apt-get install mercurial
  • Find the master OpenJDK Mercurial repository you want to start from. These instructions will usejdk7u2.
  • Command examples contain settings to allow Internet access through a proxy server; remove them if they are unnecessary for you.
  • Clone the Mercurial top-level forest repository:
  • $ mkdir jdk7u2
    $ cd jdk7u2
    $ hg --config http_proxy.host=proxy:1234 clone http://hg.openjdk.java.net/jdk7u/jdk7u2 forest
    $ cd forest
    $ sh ./get_source.sh
    The build will fail while compiling the sound libraries. As suggested here, use the following to patch the appropriate Makefile:
  • $ echo -e "--- old/jdk/make/javax/sound/jsoundalsa/Makefile    2012-01-28 12:00:00.000000000 -0500\n+++ new/jdk/make/javax/sound/jsoundalsa/Makefile    2012-01-28 12:00:00.000000000 -0500\n@@ -65,7 +65,7 @@\n \t\$(MIDIFILES_export) \\\\\n \t\$(PORTFILES_export)\n\n-LDFLAGS += -lasound\n+EXTRA_LIBS += -lasound\n \n CPPFLAGS += \\\\\n \t-DUSE_DAUDIO=TRUE \\\\" | patch -p1
    Compile:
  • $ export LANG=C ALT_BOOTDIR=/usr/lib/jvm/java-6-openjdk ANT_OPTS="-Dhttp.proxyHost=proxy -Dhttp.proxyPort=1234 -Dhttps.proxyHost=proxy -Dhttps.proxyPort=1234"
    $ . jdk/make/jdk_generic_profile.sh
    $ make ALLOW_DOWNLOADS=true fastdebug_build
       
       
    • The compile will take a while.
    • Verify the build
    $ build/linux-amd64-fastdebug/j2sdk-image/bin/java -version
    openjdk version "1.7.0-internal-fastdebug"
    OpenJDK Runtime Environment (build 1.7.0-internal-fastdebug-user_2012_01_28_13_25-b00)
    OpenJDK 64-Bit Server VM (build 22.0-b10-fastdebug, mixed mode)
    $ build/linux-amd64-fastdebug/j2sdk-image/bin/java -XX:+AggressiveOpts -XX:+UnlockDiagnosticVMOptions -XX:+PrintFlagsFinal -XX:+PrintFlagsWithComments -version
    If you have problems along the way, begin by reading The OpenJDK Developers' Guide and theOpenJDK Build README.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值