Configure the Java home variable in Linux

Source: Internet
Author: User
Here we will briefly talk about how to configure the Java home variable for Linux. If this variable is set properly, you will not need to re-set it when applying Java compilation in the future.

  •  
    1. Export path user LOGNAME mail hostname histsize inputrc
    1. Java_home =/Habitat/loocao/software/Java/jdk1.6.0 _ 13
    2. Jre_home = $ Java home/JRE
    3. Classpath =.: $ Java home/lib: $ jre_home/lib: $ classpath
    4. Path = $ java_home/bin: $ jre_home/bin: $ path
    1. Export path user LOGNAME mail hostname histsize inputrc Java home classpath jre_home
  • Configure the Java home variable in Linux. If you search for the variable on the Internet, it is estimated that most of the correct answers are:

    Export Java home = Your/Java/path

    This will have a difficulty. That is, the variable set in this method is only valid for the current user's current conversation. If you open another itll to run:

    Echo $ Java home

    The displayed result is still null value. We recommend that you do not apply this option when you re-configure the Java home variable for Linux, in addition, you only need to follow the tips to configure the lifelong application once:

    Open the/etc/profile document with the root permission and find the line similar to the following:

    Insert the following content on it:

    Edit the Export Statement and add the Java home statement as follows:

    After the configuration is complete, run the Java-version command to test it.

    Note: You need to restart your computer before it takes effect.

    Variables configured with this tip are valid for all local users, and do not need to be set repeatedly for different users.

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.