Centos7安装Oracle JDK8

作者: minichen | 来源:发表于2016-08-04 09:54 被阅读951次

    Centos7自带了OpenJDK1.8,我们不想要。想用JDK8,怎么办:

    • Download JDK1.8 rpm:
      wget http://download.oracle.com/otn-pub/java/jdk/8u101-b13/jdk-8u101-linux-x64.rpm
    • Install JDK1.8:
      sudo rpm -ivh jdk-8u101-linux-x64.rpm
    • Switch from Open JDK to Oracle JDK:
      sudo alternatives --config java* (Select the item for jdk1.8) *
    • Check it:
    which java
    java -version
    which javac
    javac -version
    

    相关文章

      网友评论

        本文标题:Centos7安装Oracle JDK8

        本文链接:https://www.haomeiwen.com/subject/mescsttx.html