雄猫不启动.我错在哪里?



>我按照说明做了所有事情,安装了所有环境变量,但它仍然没有启动。这是我尝试启动时在cmd中输出的内容:

C:WINDOWSsystem32>%CATALINA_HOME%binstartup.bat
Using CATALINA_BASE:   "D:Tomcat"
Using CATALINA_HOME:   "D:Tomcat"
Using CATALINA_TMPDIR: "D:Tomcattemp"
Using JRE_HOME:        "C:Program FilesJavajre1.8.0_131"
Using CLASSPATH:       "D:Tomcatbinbootstrap.jar;D:Tomcatbintomcat-juli.jar"
C:WINDOWSsystem32>

为蝙蝠打开一扇窗户并立即消失。http://127.0.0.1:8080/上什么都没有。可能是什么问题? 启动内容.bat:

@echo off
rem Licensed to the Apache Software Foundation (ASF) under one or more
rem contributor license agreements.  See the NOTICE file distributed with
rem this work for additional information regarding copyright ownership.
rem The ASF licenses this file to You under the Apache License, Version 2.0
rem (the "License"); you may not use this file except in compliance with
rem the License.  You may obtain a copy of the License at
rem
rem     http://www.apache.org/licenses/LICENSE-2.0
rem
rem Unless required by applicable law or agreed to in writing, software
rem distributed under the License is distributed on an "AS IS" BASIS,
rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
rem See the License for the specific language governing permissions and
rem limitations under the License.
rem ---------------------------------------------------------------------------
rem Start script for the CATALINA Server
rem ---------------------------------------------------------------------------
setlocal
rem Guess CATALINA_HOME if not defined
set "CURRENT_DIR=%cd%"
if not "%CATALINA_HOME%" == "" goto gotHome
set "CATALINA_HOME=%CURRENT_DIR%"
if exist "%CATALINA_HOME%bincatalina.bat" goto okHome
cd ..
set "CATALINA_HOME=%cd%"
cd "%CURRENT_DIR%"
:gotHome
if exist "%CATALINA_HOME%bincatalina.bat" goto okHome
echo The CATALINA_HOME environment variable is not defined correctly
echo This environment variable is needed to run this program
goto end
:okHome
set "EXECUTABLE=%CATALINA_HOME%bincatalina.bat"
rem Check that target executable exists
if exist "%EXECUTABLE%" goto okExec
echo Cannot find "%EXECUTABLE%"
echo This file is needed to run this program
goto end
:okExec
rem Get remaining unshifted command line arguments and save them in the
set CMD_LINE_ARGS=
:setArgs
if ""%1""=="""" goto doneSetArgs
set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1
shift
goto setArgs
:doneSetArgs
call "%EXECUTABLE%" start %CMD_LINE_ARGS%
:end

这很可能是一个重复的问题,但我通过快速查找找到的其他答案都没有包含如何为自己找出根本原因的基本技术,因此我在这里回答:

startup.bat启动的命令行立即消失时,只需使用catalina.bat run,它将在您当前运行的同一命令行中启动 tomcat(当然,这仅适用于命令行,您不能再双击了(。否则将显示在新打开的命令行窗口中(立即消失(的错误消息将在当前命令行中保持可见。

最有可能的是,在logs/catalina.out中也可以找到相同的内容,您也应该检查该文件。

对我来说,这是因为程序文件和文件之间有一个空格,它无法识别路径。我更改了项目的路径并将其移动到"文档"下,它起作用了。

最新更新