Ubuntu下安装JDK1.7
从Oracle官网下载软件:
解压,并移动到习惯的存放位置:
设置环境变量:
1 |
wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/7u67-b01/jdk-7u67-linux-x64.tar.gz" |
解压,并移动到习惯的存放位置:
1 2 3 4 5 |
#解压安装文件 tar -zxvf jdk-7u67-linux-x64.tar.gz rm jdk-7u67-linux-x64.tar.gz #移动解压文件 mv jdk1.7.0_67 /usr/local/jdk/1.7 |
设置环境变量:
1 2 3 4 5 |
sudo vi /etc/profile #添加以下内容: export JAVA_HOME=/usr/local/jdk/1.7 export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH export CLASSPATH=$CLASSPATH:.:$JAVA_HOME/lib:$JAVA_HOME/jre/lib |
Leave a Reply