无法在Xampp中初始化tomcat

时间:2017-11-01 17:41:05

标签: tomcat xampp

我试图将xampp用于课程,但我无法使tomcat正常工作,我得到的错误是:

" Tomcat已启动/已停止并出现错误,返回代码:1 确保安装了Java JDK或JRE,并且所需的端口是免费的 检查" / xampp / tomcat / logs"文件夹以获取更多信息"

我已经看到很多其他人遇到过这个问题,但他们得到的任何建议都没有帮助我摆脱它。

我已经解决了这样的环境变量:

  • CATALINA_HOME:C:\ xampp \ tomcat
  • CLASSPATH:C:\ xampp \ tomcat \ lib \ servlet-api.jar; C \ xampp \ tomcat \ lib \ jsp-api.jar
  • JAVA_HOME:C:\ Program Files \ Java \ jdk-9
  • JRE_HOME:C:\ Program Files \ Java \ jdk-9
  • 路径:C:\ Program Files \ Java \ jdk-9 \ bin; C:\ xampp \ Tomcat \ bin; C:\ Program Files \ Java \ jre-9 \ bin

我已经将端口设置为7070(不确定这是否有效)

当我从cmd运行CATALINA_START时,我得到了这个:

C:\xampp\tomcat>catalina_start

[XAMPP]: Searching JDK HOME with reg query ...
'reg' is not recognized as an internal or external command, operable program or batch file.
'reg' is not recognized as an internal or external command, operable program or batch file.

[XAMPP]: Seems fine!
[XAMPP]: Set JAVA_HOME : C:\Program Files\Java\jdk-9
[XAMPP]: Set CATALINA_HOME : C:\xampp\tomcat

Using CATALINA_BASE:   "C:\xampp\tomcat"
Using CATALINA_HOME:   "C:\xampp\tomcat"
Using CATALINA_TMPDIR: "C:\xampp\tomcat\temp"
Using JRE_HOME:        "C:\Program Files\Java\jre-9"
Using CLASSPATH:       "C:\xampp\tomcat\bin\bootstrap.jar;C:\xampp\tomcat\bin\tomcat-juli.jar"
-Djava.endorsed.dirs=C:\xampp\tomcat\endorsed is not supported. Endorsed standards and standalone APIs
in modular form will be supported via the concept of upgradeable modules.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

Apache和MySQL工作正常,但tomcat令人头疼?有谁知道什么是错的?

1 个答案:

答案 0 :(得分:0)

我卸载了1.9并安装了1.8并且Tomcat启动并立即工作。另一种选择是在xampp之外安装Tomcat 9并使用java 1.9运行它,但就我的目的而言,使用java 1.8运行tomcat 7就足够了。