Linux JDK environment variable settings

Source: Internet
Author: User

Although JDK environment variables have been configured many times before, they are all configured by others.CodeIt is not until this time that a problem occurs that you have to think about why this configuration is required.

If you use JDK in the system, the path must be configured as follows:

 

# Vi/etc/profile
Add the following content at the end:
# Set Java-JDK Environment
Java_home =/opt/jdk1.6.0 _ 21
# It doesn't matter whether classpath is placed before and after it is put, it means that if other jar is needed for compilation, search in this path
Classpath =.: $ classpath: $ java_home/lib/dt. jar: $ java_home/lib/tools. Jar
#Path
It must be called during Java compilation.Program(Such as Java and javac)
# Path must be followed, because when we issue the command, the system will search by path specified by path until the location is found,
# If you put it in front of the page, search for the built-in Java in the system, regardless of the Configuration. Remember, it indicates the meaning of the current path.
Path =.: $ java_home/bin: $ path
Export java_home classpath path

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.