This error keeps appearing in catalina.out

/opt/tomcat/bin/ 1: eval: /usr/lib/jvm/java-11-openjdk-amd64/bin/java/bin/java: not found

There is an extra /bin/java on the end of the path to java. I tried removing /bin/java from the environment variable for java_home, but it had no effect.

This error gets thrown whenever I try starting tomcat.

Any ideas how to fix this?

You’re on the right track, those variables should not contain the /bin/java part at the end.

I think the catalina scripts check for 2 environment variables; JRE_HOME and JAVA_HOME. My guess is that it might be using JRE_HOME if you have that set.

Try something this;

export JRE_HOME=/usr/lib/jvm/java-11-openjdk-amd64

(and/or change that to JAVA_HOME if JRE_HOME is currently unset… also make sure that path contains a bin directory with the java executable inside it)

If that resolves the issue then you’ll probably need to change that variable wherever it was originally set during startup.

Thank you.

Dropping the ‘bin/java’ from the end of $JAVA_HOME solved the problem.

1 Like