rpm安装JDK方法
- 由于版权原因,Linux发行版并没有包含官方版的Oracle JDK,必须自己从官网上下载安装。Oracle官网用Cookie限制下载方式,使得眼下只能用浏览器进行下载,使用其他方式可能会导致下载失败。但还是有方法可以在Linux进行下载的,本文以wget为例。
- 我们需要三个参数:–no-check-certificate、–no-cookies、–header,通过
man wget命令可以查到。 - 用于禁止检查证书
--no-check-certificate
Don't check the server certificate against the available certificate authorities. Also don't require the URL host name to match the common name presented by the certificate.
As of Wget 1.10, the default is to verify the server's certificate against the recognized certificate authorities, breaking the SSL handshake and aborting the download if the verification fails. Although this provides more secure downloads, it does
break interoperability with some sites that worked with previous Wget versions, particularly those using self-signed, expired, or otherwise invalid certificates. This option forces an "insecure" mode of operation that turns the certificate
verification errors into warnings and allows you to proceed.
If you encounter "certificate verification" errors or ones saying that "common name doesn't match requested host name", you can use this option to bypass the verification and proceed with the download. Only use this option if you are otherwise
convinced of the site's authenticity, or if you really don't care about the validity of its certificate. It is almost always a bad idea not to check the certificates when transmitting confidential or important data.
- 用于禁用Cookies
--no-cookies
Disable the use of cookies. Cookies are a mechanism for maintaining server-side state. The server sends the client a cookie using the "Set-Cookie" header, and the client responds with the same cookie upon further requests. Since cookies allow the
server owners to keep track of visitors and for sites to exchange this information, some consider them a breach of privacy. The default is to use cookies; however, storing cookies is not on by default.
- 用于定义请求头信息
--header=header-line
Send header-line along with the rest of the headers in each HTTP request. The supplied header is sent as-is, which means it must contain name and value separated by colon, and must not contain newlines.
You may define more than one additional header by specifying --header more than once.
wget --header='Accept-Charset: iso-8859-2' \
--header='Accept-Language: hr' \
http://fly.srk.fer.hr/
Specification of an empty string as the header value will clear all previous user-defined headers.
As of Wget 1.10, this option can be used to override headers otherwise generated automatically. This example instructs Wget to connect to localhost, but to specify foo.bar in the "Host" header:
wget --header="Host: foo.bar" http://localhost/
In versions of Wget prior to 1.10 such use of --header caused sending of duplicate headers.
接下来我们就可以用wget命令愉快的下载JDK了
- 首先我们要找到要下载JDK的URL地址,例如:http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.rpm。这个地址可以去Orcale的官网找到。
通过wget命令下载:
wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.rpm- 1
JDK我一般放在/usr/java目录下,现在我们把下载的rpm文件挪过去:
//创建目录
mkdir /usr/java //把下载的rpm文件copy过去
cp jdk-8u131-linux-x64.rpm /usr/java/添加执行权限:
//进入目录
mkdir cd /usr/java //添加可执行权限
chmod +x jdk-8u101-linux-x64.rpm执行rpm命令安装:
//安装rpm软件包
rpm -ivh jdk-8u101-linux-x64.rpm查看是否安装成功:
//查看java的版本信息
java -version
能够显示出版本信息就说明安装成功了。
java version “1.8.0_131”
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)
rpm安装JDK方法的更多相关文章
- CentOS探索之路2---使用rpm安装JDK
使用rpm安装jdk 在前一Linux探索文章中http://www.cnblogs.com/Kidezyq/p/8782728.html,有关于通过yum指令安装原生OpenJDK的命令.当时有 ...
- rpm安装jdk
rpm安装jdk:(https://blog.csdn.net/daerzei/article/details/80136457) 1.卸载系统自带的JDK rpm -qa|grep java # x ...
- centos中安装jdk方法
RPM安装方法一: 1.检验系统原版本[root@zck ~]# java -versionjava version "1.6.0_24"OpenJDK Runtime Envir ...
- CentOS 7 rpm安装jdk
RPM 安装jdk1.8.0_111 ,查询系统自带的jdk rpm -qa | grep java 查询结果如下: [root@bogon ~]# rpm -qa | grep java javap ...
- 通过rpm安装jdk
通过rpm安装,安装在/usr/local 1 .编辑系统环境变量 vi /etc/profile 输入i 加入内容如下: export JAVA_HOME=/usr/local/jdk1.7.0_7 ...
- linux下用rpm 安装jdk
转载自http://blog.csdn.net/ldl22847/article/details/7605650 1.下载jdk的rpm安装包,这里以jdk-7u4-linux-i586.rpm为例进 ...
- 记录:使用rpm安装JDK
从这个地址下载rpm文件http://www.oracle.com/technetwork/cn/java/javase/downloads/jdk8-downloads-2133151-zhs.ht ...
- CentOS下安装JDK的三种方法
方法一:手动解压JDK的压缩包,然后设置环境变量 1.在/usr/目录下创建java目录 [root@localhost ~]# mkdir/usr/java[root@localhost ~]# c ...
- CentOS安装jdk的三种方法
方法一:手动解压JDK的压缩包,然后设置环境变量 方法二:用yum安装JDK,(全称为 Yellow dog Updater, Modified)是一个在Fedora和RedHat以及CentOS中的 ...
随机推荐
- IntelliJ IDEA 2017版 spring-boot2.0.访问jsp页面;IDE Springboot JSp 页面访问
1.编译器设置. 生成项目后,点击file 点开Modules 选中main,右键 选择新建文件夹 选中外部 右边添加 选中项目如图: 选好后选OK退出 webapp带点了,就是成功了,在这里建立的J ...
- 第26章:MongoDB-索引
①索引 索引本质上是树,最小的值在最左边的叶子上,最大的值在最右边的叶子上,使用索引可以提高查询速度(而不用全表扫描),也可以预防脏数据的插入(如唯一索引). 索引通常能够极大的提高查询的效率,如果没 ...
- MySQL 安装与使用(一)
操作系统:CentOS release 5.10 (Final) 文件准备: MySQL-server-community-5.1.73-1.rhel5.i386.rpm MySQL-client-c ...
- 51nod 1239 欧拉筛模板
#include<iostream> #include<cmath> #include<cstring> #include<cstdio> #inclu ...
- (最优m个候选人 和他们的编号)Jury Compromise (POJ 1015) 难
http://poj.org/problem?id=1015 Description In Frobnia, a far-away country, the verdicts in court t ...
- linux下修改root密码以及找回密码的方法
以root身份登陆,执行: # passwd 用户名 (修改密码) # useradd 用户名 (添加用户) 具体示例如下:[root@bogon ~]# passwd root Changing p ...
- 《SQL必知必会》笔记
SQL必知必会(第4版) 作者:[美]Ben Forta 本书介绍了sql在不同数据库工具(Oracle.SQLite.SQL server.MySQL.MariaDB.PostgreSQL...)是 ...
- [au3]复制选择性粘贴文本到excel
案例:在一张网页上有许多你要复制的内容,但是你必须一个一个找到他们,然后一个一个复制出来粘贴到excel表格里.时间一长你的眼睛容易花,而且复制多了容易出错. 方法:当然有许多方法可以自动化的做这一件 ...
- CI、CD和dev-ops概念
传统的开发方式是:需求方提供文档,实现方按照文档一步步开发,中间很少变动和修改. 但是随着市场的变化,产品更新迭代的加快,也要求开放方更快的响应变化,用最短的时间开发,部署上线. 这样,持续集成(CI ...
- 异步多线程 Thread ThreadPool Task
一.线程 Thread ThreadPool 线程是Windows任务调度的最小单位,线程是程序中的一个执行流,每个线程都有自己的专有寄存器(栈指针.程序计数器等),但代码区是共享的,即不同的线程可以 ...