Centos7安装Oracle JDK8

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
    原文作者:minichen
    原文地址: https://www.jianshu.com/p/408f3c1f798e
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞