0

In my catalina.out I have this error

/opt/tomcat/bin/catalina.sh: 1: eval: Syntax error: Unterminated quoted string

I think this means that a string is declared with a quotation mark (") but it doesn't have the closing quotation mark, but I don't find the error.

Any suggestions to find the error?

I use tomcat 8.5.3.32 and I only add this to catalina.sh

JAVA_OPTS="$JAVA_OPTS -Xms2048m -Xmx4096m -XX:PermSize=512m -XX:MaxPermSize=512m"
Plijen
  • 81
  • 1
  • 7
  • ...and...? If you expect us to tell you where the missing quotation mark belongs, you left out some information that might be particularly useful for us to locate the problem... (please see [ask]) – Olaf Kock Jan 24 '23 at 16:50
  • I added one detail – Plijen Jan 25 '23 at 08:39

1 Answers1

1

It's best to restore the default catalina.sh file and never change it.

Instead, create a setenv.sh file in the same directory, and do all of your configuration there. That file will not be overwritten by a future tomcat upgrade, and will continue to keep your personal configuration changes going forward.

For the problem at hand: Evaluate if your $JAVA_OPTS already contains quotes - e.g. through a directory that contains a space. And make sure the whole expanded line is properly formatted.

But an even better fix: You don't want to make the changes you're doing in JAVA_OPTS, but in CATALINA_OPTS (here's why). Set its value - in setenv.sh - to

CATALINA_OPTS="$CATALINA_OPTS -Xms2048m -Xmx4096m -XX:PermSize=512m -XX:MaxPermSize=512m"

(or follow the other recommendation from my linked answer and use identical memory settings for -Xms and -Xmx)

Olaf Kock
  • 46,930
  • 8
  • 59
  • 90