ubuntu 12.04 下安装 java7 开发环境


删除openjava

sudo apt-get purge openjdk*

加入java7的源:

sudo add-apt-repository ppa:eugenesan/java

安装

sudo apt-get update

sudo apt-get install oracle-java7-installer

此时会提示下载失败,在http://www.oracle.com/technetwork/java/javase/downloads下载最新的jdk-7u6-linux-i586.tar.gz

将此文件复制到/var/cache/oracle-java7-installer中,

sudo gedit /var/lib/dpkg/info/oracle-java7-installer.postinst

修改如下代码:

echo “Downloading…”
#rm -f $FILENAME WGETRC=wgetrc wget $PARTNER_URL
#\ || fp_exit_with_error “download failed”
#rm -f wgetrc
echo “Download done.”

在终端得到sha256sum值

sha256sum jdk-7u6-linux-i586.tar.gz

29行7u3修改成7u6;下面数行找到sha256sum,将其值修改为上面得到的值;39行将7u3-b04修改成7u6-b24(从文件的下载地址中找到此值);修改41行J_DIR=jdk1.7.0_06(从下载的压缩包中找到)
重新安装oracle-java7-installer

sudo apt-get install oracle-java7-installer

安装成功!

ubuntu 12.04 下安装 java7 开发环境 was originally published on DormanthinkZ.C

ubuntu 12.04 下安装 java7 开发环境


删除openjava

sudo apt-get purge openjdk*

加入java7的源:

sudo add-apt-repository ppa:eugenesan/java

安装

sudo apt-get update

sudo apt-get install oracle-java7-installer

此时会提示下载失败,在http://www.oracle.com/technetwork/java/javase/downloads下载最新的jdk-7u6-linux-i586.tar.gz

将此文件复制到/var/cache/oracle-java7-installer中,

sudo gedit /var/lib/dpkg/info/oracle-java7-installer.postinst

修改如下代码:

echo “Downloading…”
#rm -f $FILENAME WGETRC=wgetrc wget $PARTNER_URL
# || fp_exit_with_error “download failed”
#rm -f wgetrc
echo “Download done.”

在终端得到sha256sum值

sha256sum jdk-7u6-linux-i586.tar.gz

29行7u3修改成7u6;下面数行找到sha256sum,将其值修改为上面得到的值;39行将7u3-b04修改成7u6-b24(从文件的下载地址中找到此值);修改41行J_DIR=jdk1.7.0_06(从下载的压缩包中找到)
重新安装oracle-java7-installer

sudo apt-get install oracle-java7-installer

安装成功!

ubuntu 12.04 下安装 java7 开发环境 was originally published on DormanThink

ubuntu 12.04 下安装 java7 开发环境 was originally published on DormanThink

ubuntu 12.04 下安装 java7 开发环境 was originally published on DormanThink

ubuntu 12.04 下安装 java7 开发环境 was originally published on DormanThink

ubuntu 12.04 下安装 java7 开发环境 was originally published on DormanThink

ubuntu 12.04 下安装 java7 开发环境 was originally published on DormanThink

ubuntu 12.04 下安装 java7 开发环境 was originally published on DormanThink

ubuntu 12.04 下安装 java7 开发环境 was originally published on DormanThink