精华内容
下载资源
问答
  • Linux 安装JDK1.8

    2020-02-07 12:15:05
    yum 安装jdk 1. 查询yum中的jdk有哪些版本 yum search java|grep -i --color jdk 2. 安装jdk yuminstalljava-1.8.0-openjdkjava-1.8.0-openjdk-deve 不安装java-1.8.0-openjdk-devel就没有javac命令 二. ...

    一. yum  安装jdk

     1. 查询yum中的jdk有哪些版本

        yum search java|grep -i --color jdk

    2. 安装jdk

    yum  install  java-1.8.0-openjdk   java-1.8.0-openjdk-deve

    不安装java-1.8.0-openjdk-devel就没有javac命令 

    二.  收到安装

    1. 检查linux是否安装jdk

    rpm -qa|grep jdk

     2. 下载linux版本的jdk

      (1).本地下载jdk并上传

         下载jdk地址:https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

      (2).在线安装jdk

    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 

    --no-check-certificate (不检查证书)

    3.安装jdk

    rpm -ivh jdk-8u131-linux-x64.rpm

    如果没有权限需要先执行:chmod +x jdk-8u131-linux-x64.rpm

    4. 检查jdk安装是否成功

      java -version

    5. 查看jdk安装路径(一般默认路径::/usr/java/)

      

      6. 配置环境变量 

           vim /etc/profile

          加入:

               export JAVA_HOME=/usr/java/jdk1.8.0_131

               export JRE_HOME=${JAVA_HOME}/jre

               export CLASSPATH=.:JAVAHOME/lib:JAVAHOME/lib:{JRE_HOME}/lib:$CLASSPATH

               export JAVA_PATH=JAVAHOME/bin:JAVAHOME/bin:{JRE_HOME}/bin

               export PATH=PATH:PATH:{JAVA_PATH}

    注意:  export PATH=PATH:PATH:{JAVA_PATH} 这个变量这样配置没有任何问题;但是当关掉当前的shell窗口或者重启Linux的时候,可能会出现-bash: ls: command not found;

    将PATH 改成下边变量就好了;

    export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:{JAVA_PATH}

    7. 检查jdk安装情况

     (1). javac

       检查是否出现 command not found,不出现就是成功

    (2) java -version

    (3) echo $PATH(查看jdk配置是否正确)

          区分大小写

     

     

     

     

     

     

    展开全文
  • Linux安装JDK1.8步骤

    2020-09-15 15:12:37
    1、检查一下系统中的jdk版本 [root@localhost software]# java -version`在这里插入代码片` 显示: openjdk version "1.8.0_102" OpenJDK Runtime Environment (build 1.8.0_102-b14) OpenJDK 64-Bit Server VM ...

    1、检查一下系统中的jdk版本

    [root@localhost software]# java -version`在这里插入代码片`
    

    显示:

    openjdk version "1.8.0_102" 
    OpenJDK Runtime Environment (build 1.8.0_102-b14) 
    OpenJDK 64-Bit Server VM (build 25.102-b14, mixed mode)
    

    2、检测jdk安装包

    [root@localhost software]# rpm -qa | grep java
    

    显示:

    java-1.7.0-openjdk-1.7.0.111-2.6.7.8.el7.x86_64 
    python-javapackages-3.4.1-11.el7.noarch 
    tzdata-java-2016g-2.el7.noarch 
    javapackages-tools-3.4.1-11.el7.noarch 
    java-1.8.0-openjdk-1.8.0.102-4.b14.el7.x86_64 
    java-1.8.0-openjdk-headless-1.8.0.102-4.b14.el7.x86_64 
    java-1.7.0-openjdk-headless-1.7.0.111-2.6.7.8.el7.x86_64
    

    3,卸载openjdk

    [root@localhost software]# rpm -e --nodeps tzdata-java-2016g-2.el7.noarch 
    [root@localhost software]# rpm -e --nodeps java-1.7.0-openjdk-1.7.0.111-2.6.7.8.el7.x86_64 
    [root@localhost software]# rpm -e --nodeps java-1.7.0-openjdk-headless-1.7.0.111-2.6.7.8.el7.x86_64 
    [root@localhost software]# rpm -e --nodeps java-1.8.0-openjdk-1.8.0.102-4.b14.el7.x86_64 
    [root@localhost software]# rpm -e --nodeps java-1.8.0-openjdk-headless-1.8.0.102-4.b14.el7.x86_64
    

    或者使用

    [root@localhost jvm]# yum remove *openjdk*
    

    之后再次输入rpm -qa | grep java 查看卸载情况:

    [root@localhost software]# rpm -qa | grep java 
    python-javapackages-3.4.1-11.el7.noarch 
    javapackages-tools-3.4.1-11.el7.noarch
    

    4、安装新的jdk

    首先到jdk官网上下载你想要的jdk版本。官网由于证书问题wget 不能直接下载,需要加忽略证书和请求头。这里下载的jdk-8u201-linux-x64.tar.gz版本的jdk。

    wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" https://download.oracle.com/otn-pub/java/jdk/8u201-b09/42970487e3af4f5aa5bca3f542482c60/jdk-8u201-linux-x64.tar.gz
    

    在/usr/local下创建java文件夹,并解压jdk-8u201-linux-x64.tar.gz安装包到该文件夹下。

    [root@localhost software]# mkdir /usr/local/java 
    [root@localhost software]# tar -xvf /usr/local/java -C /usr/local/java
    
    @[TOC](5、设置环境变量)
    
    在/etc/profile中添加如下内容:
    
    echo "export JAVA_HOME=/usr/local/java/jdk1.8.0_201" >> /etc/profile;
    echo "export JRE_HOME=${JAVA_HOME}/jre" >> /etc/profile;
    echo "export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib" >> /etc/profile;
    echo "export  PATH=${JAVA_HOME}/bin:$PATH" >> /etc/profile;
    

    6、执行profile文件

    [root@localhost software]# source /etc/profile
    

    这样可以使配置不用重启即可立即生效。

    7、检查新安装的jdk

    [root@localhost software]# java -version
    

    显示:

    java version "1.8.0_201"
    Java(TM) SE Runtime Environment (build 1.8.0_201-b09)
    Java HotSpot(TM) 64-Bit Server VM (build 25.201-b09, mixed mode)
    

    到此为止,整个安装过程结束。

    展开全文
  • Linux安装JDK1.8完整步骤

    万次阅读 多人点赞 2019-03-24 22:04:01
    1、检查一下系统中的jdk版本 [root@localhost software]# java -version 显示: openjdk version "1.8.0_102" OpenJDK Runtime Environment (build 1.8.0_102-b14) OpenJDK 64-Bit Server VM (build 25.102-...

    1、检查一下系统中的jdk版本

    [root@localhost software]# java -version

    显示:

    openjdk version "1.8.0_102" 
    OpenJDK Runtime Environment (build 1.8.0_102-b14) 
    OpenJDK 64-Bit Server VM (build 25.102-b14, mixed mode)

    2、检测jdk安装包

    [root@localhost software]# rpm -qa | grep java

    显示:

    ​
    
    java-1.7.0-openjdk-1.7.0.111-2.6.7.8.el7.x86_64 
    python-javapackages-3.4.1-11.el7.noarch 
    tzdata-java-2016g-2.el7.noarch 
    javapackages-tools-3.4.1-11.el7.noarch 
    java-1.8.0-openjdk-1.8.0.102-4.b14.el7.x86_64 
    java-1.8.0-openjdk-headless-1.8.0.102-4.b14.el7.x86_64 
    java-1.7.0-openjdk-headless-1.7.0.111-2.6.7.8.el7.x86_64
    

    3、卸载openjdk

    [root@localhost software]# rpm -e --nodeps tzdata-java-2016g-2.el7.noarch 
    [root@localhost software]# rpm -e --nodeps java-1.7.0-openjdk-1.7.0.111-2.6.7.8.el7.x86_64 
    [root@localhost software]# rpm -e --nodeps java-1.7.0-openjdk-headless-1.7.0.111-2.6.7.8.el7.x86_64 
    [root@localhost software]# rpm -e --nodeps java-1.8.0-openjdk-1.8.0.102-4.b14.el7.x86_64 
    [root@localhost software]# rpm -e --nodeps java-1.8.0-openjdk-headless-1.8.0.102-4.b14.el7.x86_64

    或者使用

    [root@localhost jvm]# yum remove *openjdk*

    之后再次输入rpm -qa | grep java 查看卸载情况:

    [root@localhost software]# rpm -qa | grep java 
    python-javapackages-3.4.1-11.el7.noarch 
    javapackages-tools-3.4.1-11.el7.noarch

    4、安装新的jdk

    首先到jdk官网上下载你想要的jdk版本。官网由于证书问题wget 不能直接下载,需要加忽略证书和请求头。这里下载的jdk-8u201-linux-x64.tar.gz版本的jdk。

    wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" https://download.oracle.com/otn-pub/java/jdk/8u201-b09/42970487e3af4f5aa5bca3f542482c60/jdk-8u201-linux-x64.tar.gz

     

    在/usr/local下创建java文件夹,并解压jdk-8u201-linux-x64.tar.gz安装包到该文件夹下。

    [root@localhost software]# mkdir /usr/local/java 
    [root@localhost software]# tar -xvf /usr/local/java -C /usr/local/java

    5、设置环境变量

    在/etc/profile中添加如下内容:

    echo "export JAVA_HOME=/usr/local/java/jdk1.8.0_201" >> /etc/profile;
    echo "export JRE_HOME=${JAVA_HOME}/jre" >> /etc/profile;
    echo "export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib" >> /etc/profile;
    echo "export  PATH=${JAVA_HOME}/bin:$PATH" >> /etc/profile;

    6、执行profile文件

    [root@localhost software]# source /etc/profile

    这样可以使配置不用重启即可立即生效。

    7、检查新安装的jdk

    [root@localhost software]# java -version

    显示:

    java version "1.8.0_201"
    Java(TM) SE Runtime Environment (build 1.8.0_201-b09)
    Java HotSpot(TM) 64-Bit Server VM (build 25.201-b09, mixed mode)

    到此为止,整个安装过程结束。

    展开全文
  • linux安装jdk1.8(rpm方式)

    万次阅读 2016-08-01 14:32:56
    由于版权原因,Linux发行版并没有包含官方版的Oracle JDK,必须自己从官网上下载安装。Oracle官网用Cookie限制下载方式,使得眼下只能用浏览器进行下载,使用其他方式可能会导致下载失败。但还是有方法可以在Linux...
    • 由于版权原因,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了

      1. 首先我们要找到要下载JDK的URL地址,例如:http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.rpm。这个地址可以去Orcale的官网找到。
      2. 通过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
      3. JDK我一般放在/usr/java目录下,现在我们把下载的rpm文件挪过去:

        //创建目录
        mkdir /usr/java
        
        //把下载的rpm文件copy过去
        cp jdk-8u131-linux-x64.rpm /usr/java/
      4. 添加执行权限:

        //进入目录
        mkdir cd /usr/java
        
        //添加可执行权限
        chmod +x jdk-8u101-linux-x64.rpm
      5. 执行rpm命令安装:

        //安装rpm软件包
        rpm -ivh jdk-8u101-linux-x64.rpm
      6. 查看是否安装成功:

        //查看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)

      借鉴:http://www.omgdba.com/download-oracle-jdk-from-official-website-using-wget-on-linux.html?utm_source=tuicool&utm_medium=referral

    展开全文
  • 前面两篇文章分别介绍了VMware...因为安装jdk1.8很简单,没什么坑,所以和安装mysql放在一起总结一下。 1. 安装jdk1.8 首先到jdk官网上下载linux版的安装包。官网由于证书问题wget 不能直接下载,需要加忽略证书和请
  • 一、 Linux安装JDK 第一步:先将软件通过xftp5上传到 /opt 下 第二步:解压缩到 /opt目录下 tar -zxvf jdk-8u121-linux-x64.tar.gz -C /opt 第三步:配置环境变量的配置文件 vim /etc/profile JAVA_HOME=/opt/jdk...
  • # 安装java-1.8.0-openjdk yum install java-1.8.0-openjdk
  • Linux jdk1.8安装

    2021-07-19 15:27:20
    查看linux现有jdk版本 查看linux java版本 java -version 查看现有linux版本的rpm rpm -qa|grep jdk 2. 删除linux npm包 rpm -e --nodeps java-1.8.0-openjdk-headless-1.8.0.65-3.b17.el7.x86_64 rpm -...
  • 从Oracle网站下载Linux x60 JDK (.tar.gz) 将jdk释放到/usr/local/java (没有文件夹则自行创建,没有权限则切换 到管理员) JDK下载完成之后,利用sftp拖到指定文件夹(一般是/home/soft01/): 压缩包可以放在普通...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 11,930
精华内容 4,772
关键字:

linux安装jdk证书

linux 订阅