LinuxQuestions.org
Help answer threads with 0 replies.
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 08-23-2004, 08:15 PM   #1
yea420
LQ Newbie
 
Registered: Aug 2004
Distribution: Red Hat 9.0
Posts: 8

Rep: Reputation: 0
JAVA_HOME Variable


Hello everyone, thanks in advance for the help,

I'm setting up my system to run java in a tomcat/apache environment, now I went at installing everything as a relative newbie. As I read more and more I realized that I should be installing java in /usr instead of /opt. I went about moving things over but now that I've changed my .bashrc echo $JAVA_HOME still gives me /opt/java, no mattter how many times I restart my machine. There is no reference to JAVA_HOME in my /etc/profile.

I realize I could move everything back to /opt/java, but I really can't stand it when I don't know what's going on, kinda feels like a hack. So here is my .bashrc, anyone that can shed some light would really help my sanity.

# .bashrc

export JAVA_HOME=/usr/java/j2sdk1.4.2_04

PATH=/usr/java/j2sdk1.4.2_04/bin:$JAVA_HOME:$PATH
export PATH

export CLASSPATH=/usr/java/j2sdk1.4.2_04/lib/tools.jar:/usr/java/j2sdk1.4.0/jre/lib/rt.jar:./

Cheers
 
Old 08-23-2004, 08:28 PM   #2
ToniT
Senior Member
 
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
~/.bashrc is not readed if you logon to your system.
~/.bash_profile or ~/.profile is instead.
 
Old 08-23-2004, 08:30 PM   #3
qwijibow
LQ Guru
 
Registered: Apr 2003
Location: nottingham england
Distribution: Gentoo
Posts: 2,672

Rep: Reputation: 47
actually... many people install java to /opt/ to seperate it from the main /usr/ because unlike everything else on the system, java is a closed source binary only install...

thats what the /opt/ folder is there for....

anyways.... apart from that....
sorry if this insults your intelligence, but you did say you are a newb.... you do realsie that things like .bashrc are only ran dureing a login.. so you will need ot log-out then back in again for the changes to take effect ?

assuming you knew that and it didnt work... have a look at your .bash_profile
i remember redhat likes to set some environment variables there.
 
Old 08-23-2004, 09:31 PM   #4
stickman
Senior Member
 
Registered: Sep 2002
Location: Nashville, TN
Posts: 1,552

Rep: Reputation: 53
Re: JAVA_HOME Variable

Quote:
Originally posted by yea420
PATH=/usr/java/j2sdk1.4.2_04/bin:$JAVA_HOME:$PATH
export PATH
On a related side note, it 's not necessary to add $JAVA_HOME to your $PATH. Typically there are not binaries in $JAVA_HOME. They are in $JAVA_HOME/bin.
 
Old 08-23-2004, 11:18 PM   #5
yea420
LQ Newbie
 
Registered: Aug 2004
Distribution: Red Hat 9.0
Posts: 8

Original Poster
Rep: Reputation: 0
k, I took the $JAVA_HOME out of my PATH, still no change.
I did check out my .bash_profile and nothing in there seemed to make any reference to $JAVA_HOME.

I did try login out, shutting down and bash'ing it a bunch. Still whenever I type:

echo $JAVA_HOME I get
/opt/java

I could edit my profile or .bash_profile, but isn't .bashrc for setting up the environment variables local to your account?
 
Old 08-24-2004, 07:47 AM   #6
stickman
Senior Member
 
Registered: Sep 2002
Location: Nashville, TN
Posts: 1,552

Rep: Reputation: 53
Did you look in /etc/profile.d?
 
Old 08-29-2004, 06:37 PM   #7
yea420
LQ Newbie
 
Registered: Aug 2004
Distribution: Red Hat 9.0
Posts: 8

Original Poster
Rep: Reputation: 0
Yep that did it,

For anyone else that has this problem I modified the file java.sh in the folder /etc/profile.d to my new JAVA_HOME and everything works great. Thanks everyone for the help
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
# ./startup.sh Neither the JAVA_HOME nor the JRE_HOME environment variable is defined Niceman2005 Linux - Newbie 3 06-29-2005 01:58 PM
setting JAVA_HOME gauravbagga Linux - Newbie 2 03-04-2005 09:17 PM
PATH and JAVA_HOME peteABK Linux - Newbie 4 10-19-2003 04:30 PM
$JAVA_HOME and $PATH magnum818 Linux - Software 2 09-30-2003 10:05 PM
JAVA_HOME and tomcat mbbender Linux - Software 5 07-07-2003 08:39 PM

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

All times are GMT -5. The time now is 10: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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration