My server is in a Unix environment. And I'm using tomcat server. I'm trying to upgrade the Java version, but tomcat is not starting after the upgrade.
which java
still gives the old version.
Below is the script for java pointing to tomcat:
if [ -z "$JAVA_HOME" -a -z "$JRE_HOME" ]; then
some script
fi
else
JAVA_PATH=`which java 2>/dev/null`
if [ "x$JAVA_PATH" != "x" ]; then
JAVA_PATH=`dirname $JAVA_PATH 2>/dev/null`
JRE_HOME=`dirname $JAVA_PATH 2>/dev/null`
fi
if [ "x$JRE_HOME" = "x" ]; then
if [ -x /usr/bin/java ]; then
JRE_HOME=/usr
fi
fi
fi
if [ -z "$JAVA_HOME" -a -z "$JRE_HOME" ]; then
echo "Neither the JAVA_HOME nor the JRE_HOME environment variable is defined"
echo "At least one of these environment variable is needed to run this program"
exit 1
fi
fi