Ubuntu 12.10中编译OpenJDK 7

参考:http://gleamynode.net/articles/2296/

参考博客中OS是Ubuntu 11.10/12.04 32位,本文的环境为Ubuntu 12.10 32位。


环境设置:

Ubuntu 12.10 32位

1.6+ 版本的JDK

在$HOME目录下新建名为workspace的目录


安装所需的包

apt-get install mercurial gawk g++ libcups2-dev libasound2-dev libfreetype6-dev libx11-dev libxt-dev libxext-dev libxrender-dev libxtst-dev libfontconfig1-dev

安装HgForeset

hg clone https://bitbucket.org/pmezard/hgforest-crew/overview/ "$HOME/Workspace/hgforest"

编辑/etc/mercurial/hgrc,添加:

[extensions] 
forest=~/workspace/hgforest/forest.py


将代码拷贝到本地:
hg fclone http://hg.openjdk.java.net/jdk7u/jdk7u "$HOME/Workspace/openjdk"


编译OpenJDK 7

cd "$HOME/Workspace/openjdk"
unset JAVA_HOME
export LANG=C
export ALT_BOOTDIR="$HOME/.local/opt/jdk/1.6"
export ALLOW_DOWNLOADS=true
export EXTRA_LIBS=/usr/lib/x86_64-linux-gnu/libasound.so
source jdk/make/jdk_generic_profile.sh
make sanity && make && echo 'Images at: build/linux-amd64/j2sdk-image'

在编译完成后,重启机器发现不出声音了,在网上找到了这个解决方案,在命令行中输入:

sudo add-apt-repository ppa:ubuntu-audio-dev/ppa; sudo apt-get update;sudo apt-get dist-upgrade; sudo apt-get install linux-sound-base alsa-base alsa-utils gdm ubuntu-desktop  linux-image-`uname -r` libasound2; sudo apt-get -y --reinstall install linux-sound-base alsa-base alsa-utils gdm ubuntu-desktop  linux-image-`uname -r` libasound2; killall pulseaudio; rm -r ~/.pulse*; sudo usermod -aG `cat /etc/group | grep -e '^pulse:' -e '^audio:' -e '^pulse-access:' -e '^pulse-rt:' -e '^video:' | awk -F: '{print $1}' | tr '\n' ',' | sed 's:,$::g'` `whoami`

你可能感兴趣的:(Ubuntu 12.10中编译OpenJDK 7)