LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   suse 9.0 java path for root (https://www.linuxquestions.org/questions/linux-software-2/suse-9-0-java-path-for-root-179073/)

randomx 05-07-2004 04:09 PM

suse 9.0 java path for root
 
I would like to set up the java path for root and the rest of the users.

steps I've done. Success on randomx user but got nowhere for root:

**I do have a valid java directory on user randomx home directory. I added this line export PATH=/home/randomx/jdk1.4/bin/:$PATH to ~/.bashrc

to test it, I typed from shell $>java -version
java version "1.4.2_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_01-b06)
Java HotSpot(TM) Client VM (build 1.4.2_01-b06, mixed mode)

Everything is beautiful.

But I cannot get the same results for root even if I try to set it in /etc/profile --usually the global settings on any linux distro but SuSE.

for root I get:
#>java -version
bash: java: command not found

again, I just want to get java for root. Any help would be greatly appreciated.

I've tried the export PATH command for root, but it's a hassle to do that every time. I just want something that stays there for ever --like on root's or global profile.

thanks in advance,

Randomx

paulsm4 05-07-2004 04:18 PM

/etc/bash.bashrc.local
 
There are several options for globally declaring environment variables.

I've had luck with creating a host-specific "/etc/bash.bashrc.local". If it exists (it won't, unless you create it), then it's read automatically by the standard shell init files. And it's probably poor form to modify those standard files directly (for example, your configuration might be blown away when you upgrade).

Hope that helps .. PSM

randomx 05-08-2004 07:47 PM

thanks bro
 
thanks man, I got it. I didn't know that trick.

randomX


All times are GMT -5. The time now is 06:19 AM.