LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 11-11-2003, 03:31 PM   #1
ergo_sum
Member
 
Registered: Aug 2003
Posts: 253

Rep: Reputation: 30
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
 
Old 11-11-2003, 03:41 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
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
 
Old 11-11-2003, 03:45 PM   #3
Looking_Lost
Senior Member
 
Registered: Apr 2003
Location: Eire
Distribution: Slackware 12.0, OpenSuse 10.3
Posts: 1,120

Rep: Reputation: 45
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.
 
Old 11-11-2003, 03:56 PM   #4
ergo_sum
Member
 
Registered: Aug 2003
Posts: 253

Original Poster
Rep: Reputation: 30
Can I do this anywhere in /etc/profile?

ergo_sum
 
Old 11-11-2003, 03:59 PM   #5
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
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
 
Old 11-11-2003, 04:03 PM   #6
Looking_Lost
Senior Member
 
Registered: Apr 2003
Location: Eire
Distribution: Slackware 12.0, OpenSuse 10.3
Posts: 1,120

Rep: Reputation: 45
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.
 
Old 11-11-2003, 04:04 PM   #7
ergo_sum
Member
 
Registered: Aug 2003
Posts: 253

Original Poster
Rep: Reputation: 30
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
 
Old 11-11-2003, 04:12 PM   #8
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
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

Last edited by Tinkster; 11-11-2003 at 04:13 PM.
 
Old 11-11-2003, 04:43 PM   #9
ergo_sum
Member
 
Registered: Aug 2003
Posts: 253

Original Poster
Rep: Reputation: 30
Done!

Thanks very much.

ergo_sum
 
Old 12-12-2003, 11:41 PM   #10
Doomhammer
Member
 
Registered: Oct 2003
Location: Montreal Qc, Canada
Posts: 105

Rep: Reputation: 15
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!!

Last edited by Doomhammer; 12-12-2003 at 11:42 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
which is the correct directory path? verbatim Programming 1 04-24-2005 11:22 PM
PATH statement from file granny Linux - Newbie 8 04-21-2005 12:58 PM
Adding directories to the PATH statement kaplan71 Slackware 2 09-02-2004 03:57 PM
PATH statement editing? cottonmouth Linux - General 2 08-17-2003 08:00 PM
What file hold the PATH statement billkris Linux - General 7 02-11-2003 10:30 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:15 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration