I have downloaded java and installed it with chmod +x and then ./bin package.
Hereunder is an output from CLI (putty)
root@hercule:/jre1.6.0_21#
root@hercule:/jre1.6.0_21# whereis java
java: /usr/share/java
root@hercule:/jre1.6.0_21#
root@hercule:/jre1.6.0_21# java -version
java version "1.6.0_21"
Java(TM) SE Runtime Environment (build 1.6.0_21-b06)
Java HotSpot(TM) Client VM (build 17.0-b16, mixed mode, sharing)
root@hercule:/jre1.6.0_21#
root@hercule:/jre1.6.0_21# pwd
/jre1.6.0_21
root@hercule:/jre1.6.0_21# ls
bin COPYRIGHT javaws lib man plugin README THIRDPARTYLICENSEREADME.txt Welcome.html
root@hercule:/jre1.6.0_21# cd bin
root@hercule:/jre1.6.0_21/bin# ls
ControlPanel java_vm jcontrol orbd policytool rmiregistry tnameserv
java javaws keytool pack200 rmid servertool unpack200
root@hercule:/jre1.6.0_21/bin# export JAVA_HOME=/jre1.6.0_21/bin/java
root@hercule:/jre1.6.0_21/bin# export PATH=$PATH:/jre1.6.0_21/bin/
root@hercule:/jre1.6.0_21/bin#
root@hercule:/jre1.6.0_21/bin# whereis java
java: /usr/share/java
root@hercule:/jre1.6.0_21/bin#
root@hercule:/jre1.6.0_21/bin# java -version
java version "1.6.0_21"
Java(TM) SE Runtime Environment (build 1.6.0_21-b06)
Java HotSpot(TM) Client VM (build 17.0-b16, mixed mode, sharing)
root@hercule:/jre1.6.0_21/bin#
root@hercule:/jre1.6.0_21/bin# cd /
root@hercule:/# cd apache-tomcat-6.0.29
root@hercule:/apache-tomcat-6.0.29# cd bin
root@hercule:/apache-tomcat-6.0.29/bin# ls
bootstrap.jar commons-daemon-native.tar.gz setclasspath.sh tomcat-juli.jar version.sh
catalina.bat cpappend.bat shutdown.bat tomcat-native.tar.gz
catalina.sh digest.bat shutdown.sh tool-wrapper.bat
catalina-tasks.xml digest.sh startup.bat tool-wrapper.sh
commons-daemon.jar setclasspath.bat startup.sh version.bat
root@hercule:/apache-tomcat-6.0.29/bin# ./catalina.sh start
Using CATALINA_BASE: /apache-tomcat-6.0.29
Using CATALINA_HOME: /apache-tomcat-6.0.29
Using CATALINA_TMPDIR: /apache-tomcat-6.0.29/temp
Using JRE_HOME: /jre1.6.0_21/bin/java
Using CLASSPATH: /apache-tomcat-6.0.29/bin/bootstrap.jar
root@hercule:/apache-tomcat-6.0.29/bin#
root@hercule:/apache-tomcat-6.0.29/bin# ./catalina.sh stop
Using CATALINA_BASE: /apache-tomcat-6.0.29
Using CATALINA_HOME: /apache-tomcat-6.0.29
Using CATALINA_TMPDIR: /apache-tomcat-6.0.29/temp
Using JRE_HOME: /jre1.6.0_21/bin/java
Using CLASSPATH: /apache-tomcat-6.0.29/bin/bootstrap.jar
./catalina.sh: 454: /jre1.6.0_21/bin/java/bin/java: not found
root@hercule:/apache-tomcat-6.0.29/bin#
I understand that the system knows the java is in a wrong place but if I do java -version it finds it correctly. I don't know and I don't understand how do I need to tell the OS that the java is somewhere else, I just did that with export java home and java path but still dosen't work, it keep tells when I do whereis java "java: /usr/share/java"
how do I fix this? What do I need to do?
here is another output that might help:
root@hercule:/apache-tomcat-6.0.29/bin# env
TERM=xterm
SHELL=/bin/bash
XDG_SESSION_COOKIE=c150847861d850d6cd1b3a8f4b928342-1285914536.524992-1521617382
SSH_CLIENT= edited 58695 edited
OLDPWD=/apache-tomcat-6.0.29
SSH_TTY=/dev/pts/0
USER=root
LS_COLORS=rs=0:di=01;34:ln=01;36:hl=44;37
i=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01
r=40;3 1;01:su=37;41:sg=30;43:ca=30;41:tw=30;42
w=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01 ;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.bz2 =01;31:*.bz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;3 1:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*. pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png =01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=0 1;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35 :*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.g l=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01; 35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36: *.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:
MAIL=/var/mail/root
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:$/jre1.6.0_21/bin:/jre1.6.0_21/bin:/jre1.6.0_21/bin/:/jre1.6.0_21/bin/
PWD=/apache-tomcat-6.0.29/bin
JAVA_HOME=/jre1.6.0_21/bin/java
LANG=en_US.UTF-8
SPEECHD_PORT=6560
SHLVL=1
HOME=/root
LOGNAME=root
SSH_CONNECTION=edited
LESSOPEN=| /usr/bin/lesspipe %s
LESSCLOSE=/usr/bin/lesspipe %s %s
_=/usr/bin/env
root@hercule:/apache-tomcat-6.0.29/bin#