LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-05-2003, 01:30 PM   #1
SkySurfinGrl
LQ Newbie
 
Registered: Sep 2003
Posts: 5

Rep: Reputation: 0
Question finishing the install for java


hey all, i have a question (a simple one i hope) so i have installed java (sdk 1.4.2) on my redhat (9) box. i used the rpm and it is unpackaged and everything into /usr/java (that's where the rpm put it) now i know i have to edit something, somewhere before java will work. i think it has something to do with /ect/profile.d but i have never changed/done this before and i'm not sure what file to change, where the file is, or what to add. any help would be greatly appreciated! thanks in advance - me

*just as a note: i have looked at the other posts about this. i'm just confused about where/what/how to edit this profiels.d document. if it is even the document i need. i looked for it and i found a folder in ect named profile.d but that's as far as i got before i got confused

Last edited by SkySurfinGrl; 09-05-2003 at 01:33 PM.
 
Old 09-05-2003, 01:48 PM   #2
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422
Red Hat can be a little goofy in where it stores things. The file you frequently see references to is /etc/profile and it contains a lot of system parameters that are set any time any user logs on. That is in contrast to the ~./bashrc (or sometimes .bash_profile or maybe even .profile) file that sets similar parameters, but for each individual user. So if you set your Java parameters in /etc/profile, all users will have those parameters even if they don't set them. If you set the Java parameters in .bashrc, then they will only be available to that specific user. If yours is a single user system, the difference between these two is minimal.

So there are two parameters you want to set, PATH and JAVA_HOME. Odds are that you already have a PATH statement in either your /etc/profile or .bashrc file. If so you can just add the /usr/java/bin directory to it. If you don't have a PATH statement, you can add it with"

PATH = $PATH:/usr/java/bin
export PATH


The first line adds /usr/java/bin to the path (and the $PATH keeps any settings already there) and the export makes it available for use.

Odds are you'll have to set JAVA_HOME since that is rarely set by default. The syntax is similar to PATH:

JAVA_HOME = /usr/java
export JAVA_HOME

Note that JAVA_HOME points to /usr/java, but PATH points to /usr/java/bin.

Have a look in your profile.d directory and see if there is a file there called profile. I'm not sure how RH sets up default parameters so the file may be named something else. Maybe a RH user will chime in here with the answer.
 
Old 09-05-2003, 03:17 PM   #3
shanenin
Member
 
Registered: Aug 2003
Location: Rochester, MN, U.S.A
Distribution: Gentoo
Posts: 987

Rep: Reputation: 30
What are you using the java for, viewing websights that require it?
 
Old 09-08-2003, 12:54 PM   #4
SkySurfinGrl
LQ Newbie
 
Registered: Sep 2003
Posts: 5

Original Poster
Rep: Reputation: 0
first off thank you for replying, now if i may buf you some more
all righty, i found the file etc/profile. and true to your word there is a path statement:

export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC

now to add the path to java/bin do i just modify the line to read:

export PATH:/usr/java/j2sdk1.4.2/bin USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC

or do i add the line: PATH = $PATH:/usr/java/j2sdk1.4.2/bin before the export PATH statement?

and for the JAVA_HOME statement, does it matter where i add the 2 lines? should it be before the export PATH statement? i hope i'm not being frustrating, and i know i'm asking you to "hold my hand" it's just i'm deathly afraid of totally crashing my system and i'm not to keen on messing with things i don't understand completely all thought i have to commend you on your response, thank you for explaining everything clearly. thank you for your time! - me

*as a response to the other reply, no i'm not using java to view web pages. i want to run Test Pilot which is a piece of software that allows people to log into my website and take a test. i need java to start the test pilot.
 
Old 09-08-2003, 01:04 PM   #5
MiscGeek
Member
 
Registered: Jan 2003
Location: Georgia, US
Distribution: RHEL WS4
Posts: 189

Rep: Reputation: 30
You want to add the PATH=$PATH:/usr/java/j2sdk1.4.2/bin on a separate line, before the export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC line.

It doesn't matter where you add the JAVA_HOME and export JAVA_HOME statements.

Mike
 
Old 09-08-2003, 02:18 PM   #6
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422
Quote:
export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC
Now while MiscGeek has it right, you don't HAVE to have the PATH = $PATH:/usr/java/j2sdk1.4.2/bin line before the export line shown above. However, if you have it afterwards, you MUST have an export line to re-export the modified PATH. Following MiscGeek's advice simply saves writing an extra line. However, be sure to have the $PATH in the line you use add java/bin. If you just have:

PATH = /usr/java/j2sdk1.4.2/bin

You will wipe out all the other paths in PATH and that could lead to some annoying consequences and generally bizarre behavior.
 
Old 09-08-2003, 03:39 PM   #7
SkySurfinGrl
LQ Newbie
 
Registered: Sep 2003
Posts: 5

Original Poster
Rep: Reputation: 0
well boyz (Hangdog42 & Mike) you have just been elevated to superhero status in my little world! i really appreciate all your help! java is up and working and it's all thanks to you! - me

p.s. so i know i used a lot of "!" but you have no idea how happy i am that it is finally working! ahh there i go again
 
Old 09-08-2003, 08:54 PM   #8
MiscGeek
Member
 
Registered: Jan 2003
Location: Georgia, US
Distribution: RHEL WS4
Posts: 189

Rep: Reputation: 30
Glad we could help
 
  


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
what directory is java install? what CMD determined where java is install? Thks. suse2166 Linux - Newbie 2 09-04-2005 08:24 PM
Finishing up KDE 3.2 upgrade amw2320 Slackware 1 05-17-2004 04:08 PM
need help with finishing gentoo Devbmx Linux - Newbie 2 05-15-2004 11:29 PM
Gentoo 2004.0 install dumps me at shell before finishing hardware detection theabyyss Linux - Distributions 4 03-21-2004 01:41 AM
Install Problem, Not Finishing? pcook911 Linux - Newbie 2 06-24-2002 06:43 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:54 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