Ubuntu--how to Install Oracle Java JDK8

Source: Internet
Author: User

    1. Check to see if your Ubuntu Linux operating system architecture are 32-bit or 64-bit, open up a terminal and run the follow ing command below.

      1. Uname-a or File/sbin/init

Linux caochu-inspiron-n5110 3.13.0-32-generic #57-ubuntu SMP Tue Jul 03:51:08 UTC x86_64 x86_64 x86_64 gnu/linux

Check If you have the Java installed on your system. To does this, you'll have a to run with 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




















This article is from the "Mr_computer" blog, make sure to keep this source http://caochun.blog.51cto.com/4497308/1759494

Ubuntu--how to Install Oracle Java JDK8

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.