SUSE / openSUSEThis Forum is for the discussion of Suse Linux.
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.
I've been trying to edit my .bash_profile to include a directory that contains the java compiler in the PATH. I'm brand new to linux and am having a hard time to say the least...my understanding is that the PATH is defined in /etc/profile but to edit it you have to use ~/.bash_profile which is looked at before /etc/profile by the system...? In windows it was a matter of clicking an "Environment Variable" button and pasting the addition to the PATH you wanted at the end behind a semi-colon. There's gotta be a way to make this work.
When bash is invoked as an interactive login shell, or as a non-inter-
active shell with the --login option, it first reads and executes com-
mands from the file /etc/profile, if that file exists. After reading
that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile,
in that order, and reads and executes commands from the first one that
exists and is readable.
right, and I can get the path to set like in the example you posted but then when I open a new session it has reset back to the original path. So I'm trying to figure out how to make it stay thanks for the response, makes it more understandable.
export PATH=$PATH:/what/ever/path >> ~/.profile
export PATH=$PATH:/what/ever/path >> ~/.bash_profile
Which ever you wanted it to work for
Note: Logged on as the normal user of course.
log off / log on
Should be there
That will append the wanted string into .profile which will run at next logon.