且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

XAMPP tomcat 服务未以错误启动,因为“Tomcat 启动/停止时出现错误,返回代码:1"

更新时间:2023-11-17 20:06:01

我遇到了同样的问题(XAMPP 7.3.0/Windows Server 2016/Java 11).我首先检查了环境变量,java安装 - 一切似乎都很好.

I had the same problem (XAMPP 7.3.0 / Windows Server 2016 / Java 11). I first checked the environment variables, the java installation - all seemed to be fine.

遗憾的是 XAMPP 错误消息不是很有意义,所以我查看了 tomcat 安装的内部.令我惊讶的是,XAMPP 7.3.0 使用了一个非常旧的 Apache Tomcat 版本(2014 年的 7.0.56!),它不适用于 Java 9+.原因是 Tomcat 7.0.56 使用-Djava.endorsed.dirs"选项,Java 9+ 不再支持该选项.最新的 Tomcat 版本对 java 9+ 没有问题.要解决此问题,您可以继续使用 Java 8(如果可能的话)或尝试通过修改 Tomcat 启动自行修复此问题:转到您的 \xampp\tomcat\ 文件夹并查看此内容修复 Tomcat 7.0.73 不适用于 Java 9.

Sadly the XAMPP error message is not very meaningful, so i looked inside of tomcat installation. To my surprise XAMPP 7.3.0 uses a very old version of Apache Tomcat (7.0.56 from 2014!), that don’t work well with Java 9+. The reason is Tomcat 7.0.56 uses the "-Djava.endorsed.dirs" option, that is no longer supported in Java 9+. Up-to-date Tomcat versions have no problem with java 9+. To solve this you can just stay with Java 8 (if possible for you) or try to fix this on your own by modify Tomcat start-up: Go to your \xampp\tomcat\ folder and see this fix in Tomcat 7.0.73 doesn't work with java 9.

但我建议你安装最新版本的 tomcat,不要使用 XAMPP(我最终做了)——至少在 XAMPP 更新 tomcat 版本之前.

But i would recommend you to install a up-to-date version of tomcat and don’t use the XAMPP one (what i finally did) - at least until XAMPP updates there tomcat version .