Linux under Configure JDK and Soft link command ln use

Source: Internet
Author: User

Java_home directory for configuring JDK under Linux

1. Create JDK folder, upload JDK, unzip

#创建目录 mkdir /usr/java# decompression unzip Jdk1. 7. 0_45_20150317. Zip

2. Edit the configuration file, configure environment variables

VI /etc/profile

Add the following configuration

Export java_home=/usr/java/jdkexport PATH= $PATH: $JAVA _home/bin: $JAVA _home/jre/binexport CLASSPATH =.: $JAVA _home/lib: $JAVA _home/jre/lib: $CLASSPATH

3, save after exiting, run

Echo $JAVA _home

You can see that the JDK environment variable is not updated, run a command, note that there are spaces

. /etc/profile

Then look at the java_home variable, the configuration is in effect, point to/USR/JAVA/JDK, but the real JDK directory is not this, but/usr/java/jdk1.7.0_45_20150317.

4. Create a soft link to create a more concise, named shortcut to the JDK's real directory.

Ln -s/usr/java/jdk1. 7. 0_45_20150317/usr/java/jdk

Complete. Linux configuration JDK Environment variables are simple, but remember to run. /etc/profile command to make the configuration take effect immediately. You can create soft links to simplify variable links.

Linux under Configure JDK and Soft link command ln use

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.