startup.bat脚本启动tomcat时,cmd命令窗口闪现问题及Neither the JAVA_HOME nor the JRE_HOME environment variable is de

Posted xuefy

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了startup.bat脚本启动tomcat时,cmd命令窗口闪现问题及Neither the JAVA_HOME nor the JRE_HOME environment variable is de相关的知识,希望对你有一定的参考价值。

解决通过startup.bat脚本启动tomcat时,cmd命令窗口闪现问题!

 

1.出现的问题是在Tomcat的解压目录的bin文件夹中,通过startup.bat脚本启动Tomcat时,命令窗口闪现;

 

 

 

2.首先我们需要了解的是通过startup.bat启动tomcat时的流程是:startup.bat--->Catalina.bat--->setclasspath.bat,然后我们在startup.bat配置文件中的末尾加上一句pause;保存成功后,重新双击startup.bat文件看看cmd窗口显示什么信息,如图所示:

 

 

 

 

报错:Neither the JAVA_HOME nor the JRE_HOME environment variable is defined 错误解决

先看Tomcat的startup.bat,它调用了catalina.bat,。

 

 而catalina.bat则调用了setclasspath.bat

 

 

只要在setclasspath.bat的开头声明环境变量,添加上自己本地jdk、jre路径即可。

 

 

在命令窗口输入:stratup启动本地tomcat(下图为启动成功)

 

以上是关于startup.bat脚本启动tomcat时,cmd命令窗口闪现问题及Neither the JAVA_HOME nor the JRE_HOME environment variable is de的主要内容,如果未能解决你的问题,请参考以下文章

运行startup.bat的启动过程

tomcat startup.bat 无法启动问题解决方法

tomcat启动时startup.bat一闪而过,在startup.bat文档后边加pause之后,出现一个界面,这种怎么解决?

Tomcat startup.bat启动时闪退,jdk都配好的,求大神解决

直接双击启动tomcat中的startup.bat闪退原因及解决方法

Windows下面startup.bat启动Tomcat偶发死锁问题