Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Java_Home not found error

Status
Not open for further replies.

newbiepg

Programmer
Nov 6, 2002
181
IN
I installed the java linux rpm(for j2se) after downloading from sun
version 1.4.1 , I believe
The installation went allright and j2sdk was installed in /usr/java

I cannot however set the java home variable in /etc/profile

This is what the /etc/profile reads now

# System wide environment and startup programs, for login setup
# Functions and aliases go in /etc/bashrc
JAVA_HOME=/usr/java/j2sdk1.4.1_02/bin
$PATH=$PATH:/usr/java/j2sdk1.4.1_02/bin

I also had tried
JAVA_HOME=/usr/java/j2sdk1.4.1_02/bin
$PATH=$JAVA_HOME:$PATH

and
JAVA_HOME=/usr/java/j2sdk1.4.1_02/bin
$PATH=$PATH:$JAVA_HOME

I keep getting the same error on
typing source /etc/profile

bash: /usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin:/usr/java/j2sdk1.4.1_02/bin: No such file or directory


when I try to run tomcat it says that I have to set the JAVA_HOME variable

Can someone tell me what I have done wrong?
Thanks
 
Try this

JAVA_HOME=/usr/java/j2sdk1.4.1_02

export JAVA_HOME

or add JAVA_HOME to the other exports


save the file and type source /etc/profile

Then type echo $JAVA_HOME
 
The problem is on this line:
[tt]$PATH=$JAVA_HOME:$PATH[/tt]
Remove the first dollar sign and it should work:
[tt]PATH=$JAVA_HOME:$PATH[/tt] //Daniel
 
guys I found the error
it seems that the j2se folder structure had been changed
redownloaded the software
thanks
$path was a problem too
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top