Configuring the JDK environment variables under Linux

Source: Internet
Author: User

Jdk:

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

Create a new software directory in the root directory

Upload the downloaded JDK to the software folder.

(using WINSCP makes it easy to drag and drop files under Windows into Linux.) )

Go to the Software directory

Input command: Cd/software

Input command: LL

You'll see our JDK package.

Three, unzip the file

Unzip command tar XZVF jdk-8u111-linux-x64.tar.gz

After decompression, you can delete the previously transmitted compressed package

deleting files rm-f jdk-8u111-linux-x64.tar.gz

5. Configuring the JDK environment variables

Configuring a JDK similar to Windows requires three environment variables to be configured

Enter the letter A or I after vi/etc/profile to enter the edit state, add the following variable in the file

Enter the command to add an environment variable:

Export java_home=/software/jdk1.8.0_111
Export classpath=.: $JAVA _home/jre/lib/rt.jar: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar
Export path= $JAVA _home/bin: $PATH

Enter the command to view the environment variables:

Echo $CLASSPATH

Echo $PATH

Enter a command to view the version of the JDK

Java-version

Configuring the JDK 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.