Results 1 to 9 of 9
Hello Forum,
I am a newbie on Linux. I am using Suse 9 server edition.
I am trying to set environment variable JAVA_HOME for my jdk installation.
for that I ...
- 09-30-2007 #1Just Joined!
- Join Date
- Sep 2007
- Posts
- 5
Urgent Please help !
Hello Forum,
I am a newbie on Linux. I am using Suse 9 server edition.
I am trying to set environment variable JAVA_HOME for my jdk installation.
for that I have edited - etc/profile this how it looks like now.
export PATH JAVA_HOME/home/usr/jdk1.5.0_12
export JAVA_HOME
now when I run the command echo $JAVA_HOME it still returns. usr/lib/java/jre..
I am tired of trying out plz help me.
thanks
- 09-30-2007 #2Linux Enthusiast
- Join Date
- Apr 2004
- Location
- UK
- Posts
- 658
Try this instead
Let us know how you get on,Code:export JAVA_HOME=/home/usr/jdk1.5.0_12 echo $JAVA_HOME
Chris...To be good, you must first be bad. "Newbie" is a rank, not a slight.
- 10-01-2007 #3Just Joined!
- Join Date
- Sep 2007
- Posts
- 5
No Success
Hello thanks for reeplying but this doesnt seem to work this is how my
/etc/profile looks like now,
export PATH JAVA_HOME/home/usr/jdk1.5.0_12/bin:$PATH
export JAVA_HOME=/home/usr/jdk1.5.0_12
echo $JAVA_HOME
still the same result.Plz help meeee...
- 10-01-2007 #4Linux Enthusiast
- Join Date
- Apr 2004
- Location
- UK
- Posts
- 658
Try doing this from the command line rather than putting things in /etc/profile for now. Once we have it working then we can look at automating it.
I don't think that like does what you want.
Try running the lines I posted before in a shell by themselves and post the actual output including any errors.
Let us know how you get on,
Chris...To be good, you must first be bad. "Newbie" is a rank, not a slight.
- 10-03-2007 #5Just Joined!
- Join Date
- Sep 2007
- Posts
- 5
Hello Chris,
I did what you said but seems like that Its not gonna work, Since After setting the Variable . When I log off & then log in again.
& Run the command echo $JAVA_HOME . it again returns the default path,
ie usr/lib/java/jre . & not home/usr/jdk. Do I need to esdit alljava.sh file?
thanks
Somil
- 10-03-2007 #6Linux Enthusiast
- Join Date
- Apr 2004
- Location
- UK
- Posts
- 658
I'm trying to break your problem into smaller parts. Once we have got the environment variables set correctly we can look at automating it.
Did those commands I gave you work for the current shell?
If so, we can look at the /etc/profile file.
Chris...To be good, you must first be bad. "Newbie" is a rank, not a slight.
- 10-05-2007 #7Just Joined!
- Join Date
- Sep 2007
- Posts
- 5
Yes , I was able to Echo the correct path. but for that session only. Can u tell me how to make it Permanent. That will be great help.
thanks
Somil
- 10-05-2007 #8Linux Enthusiast
- Join Date
- Apr 2004
- Location
- UK
- Posts
- 658
In theory putting this line in /etc/profile would fix you up:
However you posted before that you have already tried it and it didn't work. Can you post your /etc/profile file here so we can take a look please.Code:export JAVA_HOME=/home/usr/jdk1.5.0_12
There may be a problem in it or in one of the files it calls.
Let us know how you get on,
Chris...To be good, you must first be bad. "Newbie" is a rank, not a slight.
- 10-06-2007 #9Just Joined!
- Join Date
- Sep 2007
- Posts
- 5
Thanks for replying,I dont know which part of the Profille to post in here but I think this is the one you are looking For,
f test -z "$PROFILEREAD" ; then
PATH=/usr/local/bin:/usr/bin:usr/sbin:/sbin:/usr/X11R6/bin:/bin
if test "$HOME" != "/" ; then
for dir in $HOME/bin/$CPU $HOME/bin ; do
test -d $dir && PATH=$dir:$PATH
done
fi
test "$UID" = 0 && PATH=/sbin:/usr/sbin:/usr/local/sbin:$PATH
for dir in /var/lib/dosemu \
/usr/games \
/opt/bin \
/opt/gnome/bin \
/opt/kde3/bin \
/opt/kde2/bin \
/opt/kde/bin \
/usr/openwin/bin \
/opt/cross/bin
do
test -d $dir && PATH=$PATH:$dir
done
unset dir
export PATH JAVA_HOME="/home/usr/jdk1.5.0_12"
export JAVA_HOME
fi
Now how should I make it permanent?


Reply With Quote
