温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

ubuntu——How to Install Oracle Java JDK8

发布时间:2020-06-25 15:21:06 来源:网络 阅读:540 作者:_Mr_Computer_ 栏目:关系型数据库
  1. Check to see if your Ubuntu Linux operating system architecture is 32-bit or 64-bit, open up a terminal and run the following command below.    

    1. uname -a or file /sbin/init

 Linux caochu-Inspiron-N5110 3.13.0-32-generic #57-Ubuntu SMP Tue Jul 15 03:51:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

Check if you have Java installed on your system. To do this, you will have to run the Java version command from terminal.
  1. Type/Copy/Paste:java -versio

    If you have OpenJDK installed on your system, you have the wrong vendor version of Java installed for this exercise.

  2. sudo apt-get purge openjdk-*
Download the Oracle Java JDK for Linux.
  1. Unpack the compressed Java binaries, in the directory /usr/local/java8

Scroll down to the end of the file using your arrow keys and add the following lines below to the end of your./etc/profile file:
  1.  export JAVA_HOME=/usr/local/java8/jdk1.8.0_73 
     export JRE_HOME=${JAVA_HOME}/jre  
     export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib  
     export PATH=${JAVA_HOME}/bin:$PATH
  2.  source /etc/profile
 Configure default JDK version :
  1.   sudo update-alternatives --install /usr/bin/java  java  /usr/local/java8/jdk1.8.0_73/bin/java      300
     sudo update-alternatives --install /usr/bin/javac javac /usr/local/java8/jdk1.8.0_73/bin/javac    300
     sudo update-alternatives --install /usr/bin/jar   jar   /usr/local/java8/jdk1.8.0_73/bin/jar 300
     sudo update-alternatives --install /usr/bin/javah javah /usr/local/java8/jdk1.8.0_73/bin/javah  300
      sudo update-alternatives --install /usr/bin/javap javap /usr/local/java8/jdk1.8.0_73/bin/javap 300

  2. sudo update-alternatives --config java 

Test
  1. java -version




















向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI