Ubuntu14.04 install JDK

Source: Internet
Author: User

Ubuntu14.04 install JDK

System Information: 64-bit Ubuntu14.04

1. Download

Http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

Installation 2
1. Create the installation directory jvm
Open the terminal and run the following command to create a folder jvm for installing jdk:
sudo mkdir /usr/lib/jvm
2. Decompress
Unzip the downloaded installation package: jdk-8u20-linux-x64.tar.gz to the newly created Directory:/usr/lib/jvm
sudo tar zxvf ./jdk-8u20-linux-x64.tar.gz -C /usr/lib/jvm
3. Switch to the installation directory and rename it to facilitate settings.
Cd/usr/lib/jvmsudo mv jdk1.8.0 _ 20/jdk 3 configuration Environment

Open the configuration file:

gedit ~/.bashrc 
Add at the end of the file:
# jdk environmentexport JAVA_HOME=/usr/lib/jvm/jdkexport JRE_HOME=${JAVA_HOME}/jreexport CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/libexport PATH=${JAVA_HOME}/bin:$PATH
Save and exit. Enter the following command on the terminal to make it take effect:
source ~/.bashrc
4. Test
Enter the following command:
Java-version
If:
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)

Then everything is OK

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.