How to configure the Java environment for Ubuntu

Source: Internet
Author: User

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

Download a. tar.gz file

2. Configure Environment variables

After the download is complete, double-click Unzip, after the decompression is complete, press Ctrl+alt+t to open the terminal, enter the following command

sudo gedit/etc/environment

The System Environment Configuration window is then opened

Copy the path of the JDK to the bin level directory, as mine is

/home/liwen/programs/jdk8/bin

The following path please fill in your own JDK path, the path is enclosed in double quotation marks

Add after path::/home/liwen/programs/jdk8/bin

(colon equivalent to semicolon under windows, split environment variable)

Add in the following:

Java_home= "/home/liwen/programs/jdk8"

Classpath= "/home/liwen/programs/jdk8/lib:."

Ctrl + S Save

Enter the command sudo source/etc/profile to take effect, and then use the command java-version, if you see the Java version information, it means that the installation was successful.

At this point, however, only the thread that executes the sudo source/etc/profile command can use the JAVA environment variable, while the other threads are not.

After the reboot, it's all done.

Part quoted from Http://wenku.baidu.com/view/55e95da0690203d8ce2f0066f5335a8102d26666.html?from=search

and http://jingyan.baidu.com/article/e2284b2b61a2efe2e6118d39.html

How to configure the Java environment for 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.