Use Ubuntu-----to lay out your Java environment

Source: Internet
Author: User

First, download the JDK package on the network at the following URL:

Choose the version you want!

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

First, unzip the file and copy it to the directory you specified (download the package at the end of the tar)

1, unzip the file in the current directory: TAR-XZVF [package name]

2, in the Usr/local directory to establish the folder I Need "Java", give permission 755, the command is: Mkdir-m 755 java, you can also create a good file directly, later change the permissions, the command is: A, mkdir [name], B, sudo chmod 755 [file Extension

Note: Insufficient permissions can be directly added sudo

3. Move the extracted files to the created file, the command is: MV Jdk1.8.1._181/usr/local/java

Now that you've done your preparation, you can start configuring environment variables!

Second, configure the Java environment variables

Command: sudo gedit/etc/profile edit the file

Add a three-line configuration to the end of the file:

Export java_home=/usr/local/java/jdk1.8.0_181
Export classpath=.: $JAVA _home/lib: $JAVA _home/jre/lib: $CLASSPATH
Export path= $JAVA _home/bin: $JAVA _home/jre/bin: $PATH

Save!

Execute command: source/etc/profile implementation

In this case, the Java environment variables are fully configured, can be detected OK, the detection command is: Java, java-version, Javac

If there is a corresponding configuration, it represents the JDK environment OK!

For more information on Tomcat configuration, see the next blog post.

Use Ubuntu-----to lay out your Java environment

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.