Tutorial on installing and configuring the Java environment in Ubuntu16.04, ubuntu16.04java

Source: Internet
Author: User

Tutorial on installing and configuring the Java environment in Ubuntu16.04, ubuntu16.04java

1. Download jdk.

2. Verify that java is installed. Use the java-version Command, as shown in:

3. Create a jdk-8 directory in the usr directory, as shown in:

4. configure system environment variables, edit the/etc/profile file, and add the following information at the end of the file:

Export JAVA_HOME =/usr/jdk1.8.0 _ 101

Export JRE_HOME = JAVAHOME/jreexportCLASSPATH =.: "role =" presentation "> JAVAHOME/jreexportCLASSPATH =.: JAVAHOME/jreexportCLASSPATH =.: CLASSPATH: JAVAHOME/lib: "role =" presentation "> JAVAHOME/lib: JRE_HOME/lib

Export PATH = PATH: "role =" presentation "> PATH: JAVA_HOME/bin: $ JRE_HOME/bin

Export JAVA_HOME =/usr/jdk-8 is the main directory for configuring jdk

Export JRE_HOME = $ JAVA_HOME/jre is the directory for jre Configuration

Export CLASSPATH =.: CLASSPATH: "role =" presentation "> CLASSPATH: JAVA_HOME/lib: $ JRE_HOME/lib is the configured CLASSPATH directory.

Export PATH = PATH: "role =" presentation "> PATH: JAVA_HOME/bin: $ JRE_HOME/bin: add the jdk executable file directory to the system environment directory.

As shown in:

6. Use the source/etc/profile command to make the configuration take effect, as shown in:

7. Use the java-version command again for verification, as shown in:

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.