LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   please tell me if my path statement is correct on RH 7.3 (http://www.linuxquestions.org/questions/linux-newbie-8/please-tell-me-if-my-path-statement-is-correct-on-rh-7-3-a-114921/)

ergo_sum 11-11-2003 03:31 PM

please tell me if my path statement is correct on RH 7.3
 
Hello All:

I'm using RH 7.3 w/ kde on the desktop. I downloaded java a while back and never put in a path statement. Java was downloaded to /usr, so I'm thinking that the path statement goes:

export PATH=$PATH://usr/java/j2re1.4.2_01/bin

Is this correct? And do I append that to my .bashrc file? I'd like this to be on everybody's path statement. How do I do that?

Thanks,

ergo_sum

Tinkster 11-11-2003 03:41 PM

Create
/etc/profile.d/java.sh
Code:

#!/bin/bash
export PATH=$PATH:/usr/java/j2re1.4.2_01/bin
export JAVA_HOME=/usr/java/j2re1.4.2_01

chmod go+r /etc/profile.d/java.sh

Cheers,
Tink

Looking_Lost 11-11-2003 03:45 PM

If that's where your jre was installed then that's what you'd put, put it in /etc/profile for everyone to have it in their path

might want to add to /etc/profile

JAVA_HOME=/usr/java/j2re1.4.2_01

export JAVA_HOME

aswell.

ergo_sum 11-11-2003 03:56 PM

Can I do this anywhere in /etc/profile?

ergo_sum

Tinkster 11-11-2003 03:59 PM

Don't use/modify /etc/profile

It might get overwritten with your next
upgrade. The /etc/profile.d/java.sh
method is the better approach ;)
as it keeps things modular as well...

Cheers,
Tink

Looking_Lost 11-11-2003 04:03 PM

Just about, although never thought of Tinkster's way before which would keep everything nice and clean and orderly, infact I think I prefer that way now.

ergo_sum 11-11-2003 04:04 PM

Also, how do I edit the file from the command line?
I can open the file after 'su' and 'cat', but I can't edit it. How do I gain access to edit?

Thanks,

ergo_sum

Tinkster 11-11-2003 04:12 PM

Whichever editor you like mate ...

Pico, vi, emacs, mc, sed :}

You can if you need to also use
a graphical tool like kwrite or gvim,
and just chmod it from a graphical
file manager, but I think in the long
run console will be a) the faster solution,
and b) particularly useful if you screw-up
X11 some day :}

Cheers,
Tink

ergo_sum 11-11-2003 04:43 PM

Done!

Thanks very much.

ergo_sum

Doomhammer 12-12-2003 11:41 PM

Yeah, the shell is the power of linux. Im always in the shell, im the kind of guy who wants to know HOW. ive been using linux for a year now, and someday im gonna be a guru!! :)


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