Linux_CentOS下下载安装JDK及配置

1、官方JDK下载地址:http://download.oracle.com/otn-pub/java/jdk/8u92-b14/jdk-8u92-linux-x64.rpm


2、Linux下执行:wget -c -P /root/Downloads --no-check-certificate --no-cookie --header "Cookie: s_nr=1420682671945; s_cc=true; oraclelicense=accept-securebackup-cookie; gpw_e24=http%3A%2F%2Fwww.oracle.com%2Ftechnetwork%2Fjava%2Fjavase%2Fdownloads%2Fjdk7-downloads-1880260.html;s_sq=%5B%5BB%5D%5D" http://download.oracle.com/otn-pub/java/jdk/8u92-b14/jdk-8u92-linux-x64.rpm

3、建立目录:#mkdir /usr/java

4、复制下载的jdk-8u92-linux-x64.rpm到/usr/java目录中

  #cp  /root/Downloads/jdk-8u92-linux-x64.rpm   /usr/java

5、添加可执行权限,并安装

# cd /usr/java/  

# chmod +x jdk-8u92-linux-x64.rpm   

#rpm -ivh jdk-8u92-linux-x64.rpm

6、配置环境变量

进入编辑profile文件

#vim /etc/profile  

在profile文件最后追加入如下内容:
    export  JAVA_HOME=/usr/java/jdk1.8.0_91
    export  CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
    export  PATH=$PATH:$JAVA_HOME/bin

保存并退出.

7、最后执行如下

#source /etc/profile  

你可能感兴趣的:(linux,cookie,下载地址)