Ubuntu14.04 configure JDK1.8.0 _ 25 to switch the version

Source: Internet
Author: User
Ubuntu14.04 configure jdk 1.8.0 _ 25 to switch to jdk. Decompress: sudomkdir/usr/lib/jvmsudotarzxvf/home/user name/Downloads/jdk-8u25-linux-i586.tar.gz-C/usr/lib/jvm modify environment variables: // tested here you can not configure, after configuration, you cannot switch the version using the following command. Test method: H

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

Ubuntu 14.04 install JDK1.8.0 _ 25 and configure the environment variable http://www.linuxidc.com/Linux/2015-01/112030.htm

Build JDK environment http://www.linuxidc.com/Linux/2015-06/118879.htm with CentOS

Install JDK 1.8.0 _ 25 on Ubuntu 14.04 and configure Environment VariablesHttp://www.linuxidc.com/Linux/2015-01/112030.htm

Ubuntu 14.04 LTS install Oracle JDK 1.8 http://www.linuxidc.com/Linux/2014-11/109216.htm

CentOS6.3 install JDK and environment configuration http://www.linuxidc.com/Linux/2012-09/70780.htm

Ubuntu 14.04 install JDK8 http://www.linuxidc.com/Linux/2014-09/106218.htm

Install JDK graph analysis http://www.linuxidc.com/Linux/2014-09/107291.htm under Ubuntu

For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2

This article permanently updates the link address: Http://www.linuxidc.com/Linux/2015-09/122876.htm

Related Article

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.