ubuntu jdk install

1.下载jdk-7u75-linux-x64.tar.gz,默认在/home/csf/Downloads

2.csf@ubuntu:~/Downloads$ sudo mkdir /usr/java

3.csf@ubuntu:~/Downloads$ sudo tar zxvf jdk-7u75-linux-x64.tar.gz -C /usr/java

4.csf@ubuntu:/usr/java$

5.csf@ubuntu:/usr/java$ sudo gedit /etc/environment

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:$JAVA_HOME/bin"

export CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/jre/lib

export JAVA_HOME=/usr/java/jdk1.7.0_75

6.csf@ubuntu:/usr/java$ source /etc/environment

7.csf@ubuntu:/usr/java$ sudo gedit /etc/profile

#set java environment

JAVA_HOME=/usr/java/jdk1.7.0_75
export JRE_HOME=/usr/java/jdk1.7.0_75/jre
export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH

8.csf@ubuntu:/usr/java$ source /etc/profile

csf@ubuntu:/usr/java$ java -version
java version "1.7.0_75"
Java(TM) SE Runtime Environment (build 1.7.0_75-b13)
Java HotSpot(TM) Client VM (build 24.75-b04, mixed mode)

 

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。