简体   繁体   English

错误消息“/opt/tomcat/bin/catalina.sh: 1: eval: Syntax error: Unterminated quoted string

[英]error message "/opt/tomcat/bin/catalina.sh: 1: eval: Syntax error: Unterminated quoted string

In my catalina.out I have this error在我的 catalina.out 中我有这个错误

/opt/tomcat/bin/catalina.sh: 1: eval: Syntax error: Unterminated quoted string /opt/tomcat/bin/catalina.sh: 1: eval: 语法错误: 未终止的引号字符串

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我使用 tomcat 8.5.3.32,我只将它添加到 catalina.sh

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

It's best to restore the default catalina.sh file and never change it.最好恢复默认的catalina.sh文件并且永远不要更改它。

Instead, create a setenv.sh file in the same directory, and do all of your configuration there.相反,在同一目录中创建一个setenv.sh文件,并在那里进行所有配置。 That file will not be overwritten by a future tomcat upgrade, and will continue to keep your personal configuration changes going forward.该文件不会被未来的 tomcat 升级覆盖,并将继续保持您的个人配置更改。

For the problem at hand: Evaluate if your $JAVA_OPTS already contains quotes - eg through a directory that contains a space.对于手头的问题:评估您的 $JAVA_OPTS 是否已经包含引号 - 例如通过包含空格的目录。 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 ).但更好的解决方法是:您不想在 JAVA_OPTS 中进行更改,而是在 CATALINA_OPTS 中进行更改(原因如下)。 Set its value - in setenv.sh - tosetenv.sh中将它的值设置为

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) (或者按照我的链接答案中的其他建议,对 -Xms 和 -Xmx 使用相同的 memory 设置)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM