A question about a setup of PATH

Asked by jeffwang

I would like to make the users can execute the Eclipse by just running "eclipse" in the terminal(not need to go the specified directory). How can I set up the PATH in "/etc/profile"? Thanks

Question information

Language:
English Edit question
Status:
Answered
For:
Launchpad itself Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Josh Kupershmidt (schmiddy) said :
#1

If you are sure that you want to change the $PATH variable for *all* users (not just yourself), and you have root or sudo access, you should change the file /etc/bash.bashrc . If you'd rather just make this change for your user account only, you should edit the file ~/.bashrc .

The edit you should make to either of these files is to add the following line at the end:

export PATH="/path/to/eclipse/bin/:$PATH"

Where /path/to/eclipse/bin/ is the directory where your eclipse binary is located.

Obviously, to edit the system file /etc/bash.bashrc you'd have to use "sudo [your favorite text editor] /etc/bash.bashrc" -- If nano is your favorite text editor you'd type "sudo nano /etc/bash.bashrc" , and add the specified line at the end. After you've made the changes to /etc/bash.bashrc or ~/.bashrc , open a new terminal window and the changes should take effect. Type "echo $PATH" to double check the change has propagated into your current terminal window.

Hope this helps,
Josh

Can you help with this problem?

Provide an answer of your own, or ask jeffwang for more information if necessary.

To post a message you must log in.