摘要:JAVA_HOME没有设置好,Tomcat启动时没有找到JDK的路径。

Tomcat双击startup.bat启动一闪而过,没有像预想那样弹出一个DOS窗口启动Tomcat,找了一下原因,主要是JAVA_HOME没有设置好,Tomcat启动时没有找到JDK的路径。

解决方法:

打开Tomcat安装路径下的bin目录,找到startup.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.
if "%OS%" == "Windows_NT" setlocal
rem ---------------------------------------------------------------------------
rem Start script for the CATALINA Server
rem
rem $Id: startup.bat 895392 2010-01-03 14:02:31Z kkolinko $
rem ---------------------------------------------------------------------------


rem Guess CATALINA_HOME if not defined
set JAVA_HOME=C:\Program Files\Java\jdk1.7.0_07     //这里改成你JDK的安装路径
set "CURRENT_DIR=%cd%"
if not "%CATALINA_HOME%" == "" goto gotHome
set "CATALINA_HOME=%CURRENT_DIR%"
if exist "%CATALINA_HOME%\bin\catalina.bat" goto okHome
cd ..
set "CATALINA_HOME=%cd%"
cd "%CURRENT_DIR%"
:gotHome
if exist "%CATALINA_HOME%\bin\catalina.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
点击startup.bat,启动Tomcat,OK。

版权说明:如无特殊说明,文章均为本站原创,如需转载请注明出处

本文标题:Tomcat双击startup.bat启动一闪而过的问题

本文地址:http://www.wolfbe.com/detail/201608/337.html

本文标签: tomcat java

相关文章

感谢您的支持,朗度云将继续前行

扫码打赏,金额随意

温馨提醒:打赏一旦完成,金额无法退还,请谨慎操作!

扫二维码 我要反馈 回到顶部