Add to PATH (bash) for All Users (Suse)
I tried looking this one up on the net and am so far confused. I will continue looking.
In particular, I just installed the jdk-6u7 rpm, but the path is still pointing to the old 1.4.2 (at least when I run java -version) it still tells me that version number. I want to find where the path info is for that and fix it. |
By the way, I should add that there is no /etc/profile file there is an /etc/profile.d directory
Err... I take that back. Maybe I mistyped the word last time. I probably got this now. Sorry to junk up the page with another post. EDIT: Great... a new problem. I have automatic updates configured, but this file as marked as a "do not change" because updates may overwrite it. But how else can I set the path permanently for all users on the system? |
The path gets set in system profile file
to know where the path is set, may be long, but u can use bash -x to trace through the commands and find out where the path is being set. This is for bash shell only and in case of other shells appropriate command must be used. |
Quote:
I just tried to dump that in a file using bash -x > zpath.txt and now everythign is acting crazy |
pwd tells me I am in
+ pwd I think it's letting me add things to the path but it looks like I'm at a prompt. |
I'm not doing anything else until I understand what's going on before I break something.
EDIT Well, I just logged out and back in. That was screwy as hell though. So I guess I have no other options but to edit the /etc/profile file even if the Suse updater is going to kill it now and then? |
I'm completely stuck here.
I can't even FIND the old Java 1.4.2 installation. And I can't find any file that specified a path to it (or any other version of Java). I really need to get this done by Sunday night :) Your help is as always greatly appreciated! I ran the find command on the entire system seraching for *jdk* and it tells me it didn't find anything. Then I go to /usr/java/ and search there and it finds the whole 1.6 jdk. How the hell did my system wide search for *jdk* not find the 1.6 jdk (and it should have found the 1.4.2 wherever it is). |
Quote:
|
Assuming your users have the default shell of bash, then put stuff like alterations to $PATH in to /etc/bash.bashrc.local - it doesn't exist by default but if you look at /etc/bash.bashrc it tells you not to put stuff in there and use /etc/bash.bashrc.local
|
Yes they're using bash. I don't see a
bash.bashrc.local just bash.bashrc Ideally I'd like to find the file that currently says "java 1.4* this way" and edit it. I want to make back up of that file and restore it if anything goes wrong. This bash.bashrc doesn't have anything like that in it. That I can find (using /java /jdk and /$PATH in vi). |
Quote:
|
Ah yes, missed that part.
If this works, that still leaves me wondering where in blue hell java1.4.2 is installed and where the original settings for that are! So I just put.. PATH=$PATH:/usr/java/jdk1.6.0_07/bin/ ..in the file and call it a day? |
Quote:
|
If you want people to get the java that belongs to 1.6 it needs to be in $PATH before 1.4.2. So you want
Code:
PATH=/usr/java/jdk1.6.0_07/bin/:$PATH Code:
linux-poir:~ # more /etc/issue Code:
|
I just echoed my path, and the correct version of java is in it, but it's still going to 1.4.2 first.
Well, at least I know where java 1.4.2 is now :) /usr/lib/jvm/jre-1.4.2-sun/bin/java Oh **** no wonder. It has jre 1.4.2. I'm installing the jdk 1.6.0_07 not the jre. So do I have to edit all these links in the /etc/alternatives/ folder? |
All times are GMT -5. The time now is 03:37 PM. |