ubuntu——HowtoInstallOracleJavaJDK8

  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.    

    创新互联公司科技有限公司专业互联网基础服务商,为您提供服务器机柜租赁高防主机,成都IDC机房托管,成都主机托管等互联网服务。

    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


分享文章:ubuntu——HowtoInstallOracleJavaJDK8
网页链接:http://bzwzjz.com/article/pdeepc.html

其他资讯

Copyright © 2007-2020 广东宝晨空调科技有限公司 All Rights Reserved 粤ICP备2022107769号
友情链接: 成都h5网站建设 成都网站建设 成都定制网站建设 成都网站制作 营销网站建设 企业手机网站建设 响应式网站设计 网站制作公司 企业网站设计 成都网站制作 成都企业网站设计 网站建设 成都响应式网站建设 专业网站设计 成都响应式网站建设 重庆网站设计 古蔺网站建设 成都网站建设推广 四川成都网站设计 成都网站建设流程 外贸网站建设 成都网站设计