问题表现:tomcat 9.0.46 windows版本启动 start.bat时 一闪而过
解决思路: 在start.bat末尾添加pause暂停 看看报错信息情况:
保存后双击启动:
报错为:Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
At least one of these environment variable is needed to run this program
可见是java环境变量没有设置好。我们将环境变量设置好,然后再试试。
检查环境变量:命令行窗口 输入java -version
环境变量似乎是已经设置好的,那怎么回事呢?
我们先看看 我的电脑--高级系统设置--高级--环境变量里看看:
环境变量是没有设置的,我们设置一下。
我们试试:
此时没有报错了,那么我们记得把start.bat里的pause去掉还原即可。
另外一种方式可以试试:(1条消息) Neither the JAVA_HOME nor the JRE_HOME environment variable is defined 错误解决_王小波-CSDN博客