Ubuntu14.04 install Oracle JDK

Source: Internet
Author: User

Ubuntu14.04 install Oracle JDK

Install Oracle JDK 6, 7, or 8 on Ubuntu 14.04.

Preparation: add-apt-repository Tool

#apt-get install python-software-properties
#apt-get install software-properties-common

Step 1: Add PPA repository to the System

#add-apt-repository ppa:webupd8team/java 

Step 2: Update

#apt-get update

Step 3: download and install JDK

#apt-get install oracle-java6-installer

JDK 6 is installed here. If you want to install JDK 7 or JDK 8, change 6 in the preceding statement to the corresponding number.

Step 4: Set to default (skip this step if JDK of another version is not installed)

#apt-get install oracle-java6-set-default

Similarly, you need to change 6 to the corresponding 7 or 8.

Step 5: view the version

#java -version  

Step 6: Set Environment Variables

Add the following content to the end of the/etc/profile file:

#vi /etc/profile

Add at the end of the file

#jdkexport JAVA_HOME=/usr/lib/jvm/java-6-oracleexport JRE_HOME=${JAVA_HOME}/jre  export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib  export PATH=${JAVA_HOME}/bin:$PATH 
To set the installed JDK to the default JDK version, perform the following operations.
Run the Code:
#update-alternatives --install /usr/bin/java java /usr/lib/jvm/java-7-oracle/bin/java 300
#update-alternatives --config java

Install JDK 1.8.0 _ 25 on Ubuntu 14.04 and configure Environment Variables

Build a JDK environment using CentOS

Install JDK 1.8.0 _ 25 on Ubuntu 14.04 and configure Environment Variables

Install Oracle JDK 14.04 on Ubuntu 1.8 LTS

CentOS6.3 install JDK and environment Configuration

Install JDK 8 on Ubuntu 14.04

Install JDK graph analysis in Ubuntu

This article permanently updates the link address:

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.