(转)Neither the JAVA_HOME nor the JRE_HOME environment variable is defined解决方案
转自:http://blog.csdn.net/qq_18423547/article/details/51775732
今天做项目,为了测试,我把mysql数据库表中一个字段值改了。重启mysql和memcached服务后,启动项目,发现页面显示的内容还是修改前的值。经过各种清理缓存,(项目缓存等),都没有效果。后来观察myeclipse中tomcat启动过程,时间比以前偏短。虽然很多异常并不懂,我试着在dos界面开启或关闭tomcat,报了这个异常。
通过网友的提示,了解到:较新版本的JDK安装好后,不会自动等级环境变量JAVA_HOME,JRE_HOME。
Tomcat中的startup.bat调用了catalina.bat,而catalina.bat调用了setclasspath.bat。
在setclasspath开头声明环境变量:
rem In debug mode we need a real JDK (JAVA_HOME)
if ""%1"" == ""debug"" goto needJavaHome
set JAVA_HOME=C:/Program Files/Java/jdk1.7.0_67
set JRE_HOME=C:/Program Files/Java/jre7
rem Otherwise either JRE or JDK are fine
if not "%JRE_HOME%" == "" goto gotJreHome
if not "%JAVA_HOME%" == "" goto gotJavaHome
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
再重新启动项目,就好了
推荐阅读
-
tomcat启动报错:Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
-
Tomcat9+JDK 13报错Neither the JAVA_HOME nor the JRE_HOME environment variable is defined At least one of these environment variable is needed to run thi
-
Neither the JAVA_HOME nor the JRE_HOME environment variable is defined At least one of these enviro
-
关于Tomcat打开 **闪退** 及出现 **Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
-
Neither the JAVA_HOME nor the JRE_HOME environment variable is defined 完美解决(tomcat error)
-
tomcat8.0启动时显示错误:Neither the JAVA_HOME nor the JRE_HOME environment ... ...
-
Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
-
(转)Neither the JAVA_HOME nor the JRE_HOME environment variable is defined解决方案
-
jira error: Neither the JAVA_HOME nor the JRE_HOME environment variable is defin
-
jira error: Neither the JAVA_HOME nor the JRE_HOME environment variable is defin