Ubuntu 14.04 Configuration Java SE

Source: Internet
Author: User
Tags java se

First download Java se,:http://www.oracle.com/technetwork/java/javase/downloads/index.html;

After downloading the compressed package to the custom directory decompression can be (for example: In the/usr/lib/set up a Java directory, the compression package extracted into the directory);

There are two ways of configuring environment variables:

1, modify BASHRC:

sudo nano ~/.BASHRC

Then add the following code:

Export java_home=/usr/lib/java/jdk1.8.0_20/

Export JRE_HOME=${JAVA_HOME}/JRE

Export Classpath=.:${java_home}/lib:${jre_home}/lib

Export Path=${java_home}/bin: $PATH

2, Modify Environment:

sudo nano/etc/environment

Add the Bin directory of the JDK after the existing path variable, and note that the colon is separated from the existing variable

Add Calsspath and Java_home variables again

My situation is as follows:

Path= "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/java/ Jdk1.8.0_20/bin "

Classpath= "/usr/lib/java/jdk1.8.0_20/lib:." Notice there's a point in the back.

Java_home= "/usr/lib/java/jdk1.8.0_20/"

After modifying the configuration, log off or restart to make the environment variable effective!

See if it takes effect, terminal execution: java-version, you can see the version.

Ubuntu 14.04 Configuration Java SE

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.