I am fairly new to linux and have been facing this issue and was wondering if something can help resolve it. So when I try to shutdown Tomcat, this is the error I am getting. As you can see 'bin' is repeated in the path. I can see that its picking up the wrong path but not sure what variable needs to be modified as I checked $JAVA_HOME and $PATH, and they seem to be fine.
bash-4.1$ ./shutdown.sh Using CATALINA_BASE: /apps/opt/apache-tomcat-7.0.77 Using CATALINA_HOME: /apps/opt/apache-tomcat-7.0.77 Using CATALINA_TMPDIR: /apps/opt/apache-tomcat-7.0.77/temp Using JRE_HOME: /usr/java/jre1.8.0_121/bin Using CLASSPATH: /apps/opt/apache-tomcat-7.0.77/bin/bootstrap.jar:/apps/opt/apache-tomcat-7.0.77/bin/tomcat-juli.jar /apps/opt/apache-tomcat-7.0.77/bin/catalina.sh: line 467: /usr/java/jre1.8.0_121/bin/bin/java: No such file or directory
Also, the checked like 467 and this is what it says which I am not sure what to make. This is how it looks like:
466 467 eval "\"$_RUNJAVA\"" $LOGGING_MANAGER $JAVA_OPTS \ 468 -Djava.endorsed.dirs="\"$JAVA_ENDORSED_DIRS\"" -classpath "\"$CLASSPATH\"" \ 469 -Dcatalina.base="\"$CATALINA_BASE\"" \
Also here's what PATH and JAVA_HOME look like.
bash-4.1$ echo $JAVA_HOME :/usr/java/jre1.8.0_121/bin/java bash-4.1$ echo $PATH /usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/vzwhome/mehtta4/bin:/apps/opt/databuck/opt/bin:/apps/opt/databuck/opt/node/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/vzwhome/mehtta4/bin:/usr/java/jre1.8.0_121/bin/java