Install JDK 8 on Ubuntu 14.04

Source: Internet
Author: User

Install JDK 8 on Ubuntu 14.04

Install JDK 8 in Ubuntu 14.04.

Check whether jdk-related software is installed in the system. You can directly enter the java command:

# If the prompt is apt-get install <selected software package>, the system is not installed by default.
Www.bkjia.com @ bkjia :~ $ Java-version

Download the source code and decompress it:
Www.bkjia.com @ bkjia :~ $ Wget
Junluobj @ junluobj :~ $ Sudo mkdir/usr/lib/jvm
Www.bkjia.com @ bkjia :~ $ Tar zvxf jdk-8u20-linux-x64.tar.gz
Www.bkjia.com @ bkjia :~ $ Sudo mv jdk1.8.0 _ 20 // usr/lib/jvm/

Set JDK environment variables:
Www.bkjia.com @ bkjia :~ $ Sudo vim ~ /. Profile
# Set jdk env
Export JAVA_HOME =/usr/lib/jvm/jdk1.8.0 _ 20/
Export JRE_HOME =/usr/lib/jvm/jdk1.8.0 _ 20/jre
Export CLASSPATH =.: $ JAVA_HOME/lib/dt. jar: $ JAVA_HOME/lib/tools. jar: $ JAVA_HOME/lib: $ JRE_HOME/lib: $ CLASSPATH
Export PATH = $ JAVA_HOME/bin: $ PATH

# Save and exit. Enter the following command to make it take effect immediately.
Www.bkjia.com @ bkjia :~ $ Source ~ /. Profile

Verify JDK:
Www.bkjia.com @ bkjia :~ $ Java-version
Java version "1.8.0 _ 20"
Java (TM) SE Runtime Environment (build 1.8.0 _ 20-b26)
Java HotSpot (TM) 64-Bit Server VM (build 25.20-b23, mixed mode)

If openjdk has been installed in the system, follow these steps to update it:
Www.bkjia.com @ bkjia :~ $ Sudo update-alternatives -- install/usr/bin/java/usr/lib/jvm/jdk1.8.0 _ 20/bin/java 300
Update-alternatives: using/usr/lib/jvm/jdk1.8.0 _ 20/bin/java to provide/usr/bin/java (java) in auto mode
Www.bkjia.com @ bkjia :~ $ Sudo update-alternatives -- install/usr/bin/javac/usr/lib/jvm/jdk1.8.0 _ 20/bin/javac 300
Update-alternatives: using/usr/lib/jvm/jdk1.8.0 _ 20/bin/javac to provide/usr/bin/javac (javac) in auto mode
Www.bkjia.com @ bkjia :~ $ Sudo update-alternatives -- config java
Www.bkjia.com @ bkjia :~ $ Sudo update-alternatives -- config javac

Install JDK 7 In Ubuntu (with Clojure download)

Install JDK 12.04 in Ubuntu

CentOS6.3 install JDK and environment Configuration

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.