Linux environment variable Configuration

Source: Internet
Author: User

configuration file and execution order:

1>/etc/profile, System level, will call/ETC/BASH.BASHRC

2>/etc/enviroment, System level, setting system-level environment variables

3> ~/.profile, user-level

4> ~/.BASHRC, User level

5> ~/.bash_profile or ~./bash_login-if One of these file exist, bash executes it rather then ' ~/.profile ' when it is s tarted as a login shell. (Bash would prefer "~/.bash_profile" to "~/.bash_login"). However, these files won ' t influence a graphical session by default.

Configuration method:

Export path= "$PATH:/my_new_path"

The Java environment switches from Openjava to Oracl Java, in addition to setting environment variables, you need to do the following:

1> marking a new Java environment

sudo update-alternatives--install/usr/bin/java java $JAVA _home/bin/java 300

sudo update-alternatives--install/usr/bin/javac javac $JAVA _home/bin/javac 300

2> Select the ID of 300

sudo update-alternatives--config java

sudo update-alternatives--config JavaC

Linux environment variable Configuration

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.