Linux installation JDK 8 and environment variable configuration

Source: Internet
Author: User

1. Download JDK

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

2. Unzip the file you just downloaded to the/USR/LIB/JVM folder, and if you don't have the folder, you can create a new folder

Cp-r/home/xx/Download/JDK1.8.0_25/USR/LIB/JVM

3. Configure Environment variables

Typing command:

gedit~/. BASHRCon the last add:
1234 ExportJava_home=/usr/Lib/JVM/jdk1.8.0_25ExportJre_home=${Java_home}/JREExportCLASSPATH=.:${Java_home}/Lib:${Jre_home}/LibExport PATH=${Java_home}/bin:$PATH
Save exit, enter the following command to make the environment variable of this configuration take effect
Source ~/. BASHRC
4. Configure the default JDK version and execute the following commandsudoUpdate-Alternatives--Install/usr/Li/JavaJava/usr/Lib/JVM/jdk1.8.0_25/bin/Java -sudoUpdate-Alternatives--Install/usr/bin/JavacJavac/usr/Lib/JVM/jdk1.8.0_25/bin/Javac -5. TestingOpen a terminal input dimly command java-version
Outputjava Version "1.8.0_25"
Java (TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot (TM) Server VM (build 25.25-b02, Mixed mode)
indicates a successful test.

Linux installation JDK 8 and environment variable configuration

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.