soarli

Java环境导致tomcat启动时报错解决方案
转载了一篇文章,来源见文末。启动tomcat时报Neither the JAVA_HOME nor the JRE...
扫描右侧二维码阅读全文
06
2020/12

Java环境导致tomcat启动时报错解决方案

转载了一篇文章,来源见文末。

启动tomcat时报Neither the JAVA_HOME nor the JRE_HOME environment variable is defined 的解决方案

解决方法:

先看Tomcat的startup.bat,它调用了catalina.bat,而catalina.bat则调用了setclasspath.bat。只要在setclasspath.bat的开头声明环境变量.像我这样 : 加上红色的两句就OK拉 (当然了JAVA_HOME的路径 请填写你自己的)

rem —————————————————————————

rem Set CLASSPATH and Java options

rem

rem $Id: setclasspath.bat 795032 2009-07-17 10:41:20Z markt $

rem —————————————————————————

 

set JAVA_HOME=C:\Program Files\Java\jdk1.6.0_10
set JRE_HOME=C:\Program Files\Java\jdk1.6.0_10\jre



rem Make sure prerequisite environment variables are set

if not "%JAVA_HOME%" == "" goto gotJdkHome

if not "%JRE_HOME%" == "" goto gotJreHome

echo Neither the JAVA_HOME nor the JRE_HOME environment variable is defined

echo At least one of these environment variable is needed to run this program

goto exit

原文地址:

https://blog.csdn.net/hi_kevin/article/details/6602374

最后修改:2022 年 01 月 07 日 05 : 48 PM

发表评论