Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
i recently downloaded and installed j2re (java runtime environment) and was advised to
make sure java binary was in my PATH. i used export PATH="$PATH:/<path to java>"
which worked fine during current session but change went away when i logged out. does
anyone know how to make the changes permanent?
You can edit your ~/.bash_profile command and add 'PATH=$PATH:<path to java>"
export path
If there isn't a ~/.bash_profile, bash looks for ~./bash_login or ~/.profile. If you don't have one of these files, you can create one.
It is better to use a login script for this, because if you used ~/.bashrc instead, it would be executed every time you started another shell. The result you be the $PATH variable growing with the same path being added to the end.
I have also been trying to do this, but I have had no kind of luck getting the path set to work. I'm running Mandrake 10.1, and in my /etc/profile i have ->
To state what may be obvious, check the "PATH=" line mentioned, and be sure that:
- this line is actually executed (remember that there are functions, "case" and "if/then" statements there), and
- the line isn't later superceded by a PATH= line that doesn't preserve your additions (ie: It doesn't have $PATH after the equal sign).
Adding it as the last line in the "/etc/profile" file should fix both potential problems.
That should fix it, but instead I'd suggest you add a file under /etc/profile.d, with a ".sh" suffix -- it will be used with BASH, SH, KSH, etc.
If you're still having issues, tell us what distro+version you're running, what shell you use, what you *do* have for your $PATH and the output of:
grep PATH= /etc/profile /etc/profile.d/*.sh ~/.bash* /etc/bashrc
Cheers
Incidentally, as long as there aren't any spaces or shell syntax tokens in the variable assignments, the double quotes are optional.
[Here "tokens" include: parens, pipes, ampersands, greater/less than, and probably a few others I forgot.]
thanks for all he input. what i finally did (that worked)
was add line to .bashrc (in both /home/user and /root)
export PATH=/my/old/path:/path/addition
which i then edited by deleting an extra instance of he path components '/home/user/bin and /root/bin' which
the above command for unknown reason added to the
end. (i deleted the instance at the end of the original
path)
This thread has just helped me to install maple 9 on Mandrake 10.1, thank you!
However a very strange thing happens once I try to use xmaple.
I can start and use it but the backspace button on my keyboard (a german one) will not work. Worse than that is that e.g. x² will not work with the usual "to the power of" button.
I hope I am not asking complete nonsense, but I am still very new in the linux world.
Distribution: Ubuntu, Debian, Various using VMWare
Posts: 2,088
Rep:
Quote:
Originally posted by deucedlt thanks for all he input. what i finally did (that worked)
was add line to .bashrc (in both /home/user and /root)
export PATH=/my/old/path:/path/addition
which i then edited by deleting an extra instance of he path components '/home/user/bin and /root/bin' which
the above command for unknown reason added to the
end. (i deleted the instance at the end of the original
path)
A better place to put that line is in ~/.bash_profile. This is because this file is only read when you login. ~/.bashrc is read each time you start an xterm, so your path will get longer and longer...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.