使用wget命令:
wget --no-cookies --no-check-certificate --header "Cookie:gpw_e24=http%3a%2f%2fwww.oracle.com%2ftechnetwork%2fjava%2fjavase%2fdownloads%2fjdk8-downloads-2133151.html;oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u11-b12/jdk-8u11-linux-x64.rpm
代码运行如下:
[root@localhost local]# wget --no-cookies --no-check-certificate --header "Cookie:gpw_e24=http%3a%2f%2fwww.oracle.com%2ftechnetwork%2fjava%2fjavase%2fdownloads%2fjdk8-downloads-2133151.html;oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u11-b12/jdk-8u11-linux-x64.rpm
--2014-12-22 14:00:03-- http://download.oracle.com/otn-pub/java/jdk/8u11-b12/jdk-8u11-linux-x64.rpm
Resolving download.oracle.com... 23.4.92.19, 23.4.92.25
Connecting to download.oracle.com|23.4.92.19|:80... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://edelivery.oracle.com/otn-pub/java/jdk/8u11-b12/jdk-8u11-linux-x64.rpm [following]
--2014-12-22 14:00:05-- https://edelivery.oracle.com/otn-pub/java/jdk/8u11-b12/jdk-8u11-linux-x64.rpm
Resolving edelivery.oracle.com... 184.85.118.140
Connecting to edelivery.oracle.com|184.85.118.140|:443... connected.
WARNING: certificate common name `www.oracle.com' doesn't match requested host name `edelivery.oracle.com'.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: http://download.oracle.com/otn-pub/java/jdk/8u11-b12/jdk-8u11-linux-x64.rpm?AuthParam=1419228127_ae20d25de619e23453743e043bcd782d [following]
--2014-12-22 14:00:08-- http://download.oracle.com/otn-pub/java/jdk/8u11-b12/jdk-8u11-linux-x64.rpm?AuthParam=1419228127_ae20d25de619e23453743e043bcd782d
Reusing existing connection to download.oracle.com:80.
HTTP request sent, awaiting response... 200 OK
Length: 140393310 (134M) [application/x-redhat-package-manager]
Saving to: `jdk-8u11-linux-x64.rpm?AuthParam=1419228127_ae20d25de619e23453743e04
.......
等待下载完成即可,完成之后使用rpm -ivh 文件名进行安装
再使用java -version进行检验即可。