Configuring Java environment variables under Linux

Source: Internet
Author: User

In general, we will install Java into the/usr/local directory or the/opt directory. This assumes that the Java installation package has been unzipped under/OPT, the specific directory is:/opt/java8/java1.8.0_25 directory.

Let's configure the Java environment variable and open /etc/profile after the file:

$ export java_home=/opt/java8/java1.8.0_25$ export path= $JAVA _home/bin: $JAVA _home/jre/bin: $PATH $ export classpath=.: $JAVA _home/lib: $JAVA _home/jre/lib

Note: The environment variable must not take a space , otherwise it will be an error.

After the update completes the profile, let's take one more line of the following statement:

$ source/etc/profile

Final execution:

$ java-version

Look at the Java installation configuration is not successful!! The modified configuration file will eventually take effect or log off to log back in or restart the computer !!

Configuring Java environment variables under Linux

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.