Install Java environment under Ubuntu

Source: Internet
Author: User

Http://www.oracle.com/technetwork/cn/java/javase/downloads/jdk8-downloads-2133151-zhs.html

2 Log the downloaded jdk-8u92-linux-x64.tar.gz file to the/temp directory with the root user login and unzip it using the following command

Tar zxvf jdk-8u92-linux-x64.tar.gz

3 Copy the extracted jdk1.8.0_92 to/opt under the following command:

[Email protected]:~# mkdir/temp
[Email protected]:~# cd/temp
[Email protected]:/temp# tar zxvf jdk-8u92-linux-x64.tar.gz
[Email protected]:/temp# cd/opt
[Email protected]:/opt# mv/temp/jdk1.8.0_92/.
[Email protected]:/opt# ls-l
Total Dosage 4
Drwxr-xr-x 8 UUCP 143 4096 April 1 12:20 jdk1.8.0_92

4 Creating a Java Soft link in the/bin directory

[Email protected]:/opt# cd/bin
[Email protected]:/bin# ln-s/opt/jdk1.8.0_92/bin/java java

Verify the correctness of the software connection

[Email protected]:/bin# java-version
Java Version "1.8.0_92"
Java (TM) SE Runtime Environment (build 1.8.0_92-b14)
Java HotSpot (TM) 64-bit Server VM (build 25.92-b14, Mixed mode)

5 Setting up the Java environment

[Email protected]:/bin# gedit/etc/profileexport Java_home=/opt/jdk1.8.0_92export Jre_home=${java_home}/jreexport Classpath=.:${java_home}/lib:${jre_home}/libexport path={java_home}/bin: $PATH [email protected]:/bin# source/etc/ Profile[email protected]:/bin# Echo $JAVA _home/opt/java1.8.0_92

6 Switch to other user authentication

[Email protected]:~$ echo $JAVA _home/opt/jdk1.8.0_92[email protected]:~$ java-versionjava Version "1.8.0_92" JAVA (TM) SE Runtime Environment (build 1.8.0_92-b14) Java HotSpot (TM) 64-bit Server VM (build 25.92-b14, Mixed mode)

Install Java environment under 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.