Configure JDK 1.8.0 _ 25 in Ubuntu 14.04 and switch the version.

Source: Internet
Author: User

Configure JDK 1.8.0 _ 25 in Ubuntu 14.04 and switch the version.

Configure jdk 1.8.0 _ 25 in Ubuntu 14.04. You can switch the version to jdk.

Decompress:

Sudo mkdir/usr/lib/jvm

Sudo tar zxvf/home/user name/Downloads/jdk-8u25-linux-i586.tar.gz-C/usr/lib/jvm

Modify the environment variable: // The environment variable is not configured after the test. After the configuration, the following command cannot be used to switch the version.

Test method: Hadoop-2.6.0 with jdk1.8.25 compilation will be wrong, but with openjdk will not, by setting different versions, indeed when the 1.8.25 error occurs, so do not configure here.

Sudo gedit/etc/profile

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

Save and exit. Enter the following command to make it take effect immediately.

Configure the default JDK:

Sudo update-alternatives -- install/usr/bin/java/usr/lib/jvm/jdk1.8.0 _ 25/bin/java 300
Sudo update-alternatives -- install/usr/bin/javac/usr/lib/jvm/jdk1.8.0 _ 25/bin/javac 300
// Do not configure the following two items
Sudo update-alternatives -- install/usr/bin/javah/usr/lib/jvm/jdk1.8.0 _ 25/bin/javah 300
Sudo update-alternatives -- install/usr/bin/jar/usr/lib/jvm/jdk1.8.0 _ 25/bin/jar 300
// Version switch command

Sudo update-alternatives -- config java
Sudo update-alternatives -- config javac

Test

Java-version
Javac-version

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

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.