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

Source: Internet
Author: User

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

The following are notes about installing JDK 1.8.0 _ 25 on Ubuntu 14.04 and configuring environment variables.

1. source code package preparation:

First, download jdk and supervisor from the official website.

2. decompress the source code package.

Create a java folder in the/usr/local directory on the terminal and run the following command:

2. decompress the source code package.
Create a java folder in the/usr/local directory on the terminal and run the following command:

Sudo mkdir/usr/local/java

Copy the downloaded package to the java folder and run the following command:
Go to the directory where the jdk source code package is located

Cp jdk-8u25-linux-x64.tar.gz/usr/local/java

Go to the java directory and run the following command:

Cd/usr/local/java

Decompress the package and run the following command:

Sudo tar xvf jdk-8u25-linux-x64.tar.gz

Then you can delete the compressed package. command line:

Sudo rm jdk-8u25-linux-x64.tar.gz

3. Set jdk Environment Variables

The global setting method is used, which is an environment variable shared by all users.

$ Sudo gedit ~ /. Bashrc

As shown in:


Open and add at the end

Export JAVA_HOME =/usr/local/java/jdk1.8.0 _ 25
Export JRE_HOME =$ {JAVA_HOME}/jre
Export CLASSPATH =. :$ {JAVA_HOME}/lib :$ {JRE_HOME}/lib
Export PATH =$ {JAVA_HOME}/bin: $ PATH

Remember, do not add spaces on both sides of the equal sign during the above process. Otherwise, "invalid identifiers" will appear, because unnecessary spaces cannot be identified during source/etc/profile, it is understood as part of the path.
Save the settings.

4. Check whether the installation is successful.
Enter the following command on the terminal:
Java-version
Check whether the installation is successful
The result is as follows:

Install JDK and configure environment variables in Ubuntu

Install JDK 7 In Ubuntu (with Clojure download)

Install JDK 12.04 in Ubuntu

CentOS6.3 install JDK and environment Configuration

Ubuntu14.04 64-bit JDK1.7 Installation

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.