[Centos] Fix setup java_home continuous failure problem

Source: Internet
Author: User

Problem restore: As we all know, to modify the global configuration of CentOS, you can modify the/etc/profile file, for example, I need to modify the Java_home variable, so in general we just change in it, source a bit on the line.

But the situation I encountered this time is: View/etc/profile, Java_home path, and I modified the new path is consistent,

Use $java_home to view, such as:

But the problem came, and after a while, I jumped to another similar but different directory:

After troubleshooting, the problem is found:./BASHRC in this file,

. BASHRC: This file primarily stores personal personalization settings, such as command aliases, paths, and so on. That is, on the same server, it is only relevant to the personalization settings of a user.

The. BASHRC is typically called explicitly in the. bash_profile file. When you log in to Linux to start bash, you will first read the ~/.bash_profile file so that ~/.BASHRC is executed and your personalization will take effect.

My understanding is this: you define the priority in BASHRC is higher than the content inside the profile, so if the two file profiles and BASHRC inside the same setting, the path is defined, then the system will first select the content of BASHRC.

So, for the java_home path problem I encountered, the solution I took was: directly BASHRC the definition inside .

Of course you can also leave the definition of bashrc inside, delete the definition of profile.

[Centos] Fix setup java_home continuous failure problem

Related Article

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.