安装tomcat启动出现Neither the JAVA_HOME nor the JRE_HOME environment variable is defined

博主是一个非常偷懒的人,java环境变量,mysql环境变量,tomcat环境变量,这些变量感觉能简化就简化,所以在电脑里面的环境变量都是直接在path复制路径,才导致在安装tomcat启动时,出现Neither the JAVA_HOME nor the JRE_HOME environment variable is defined 。

所以博主又乖乖的把路径变量都添加回去了,哈哈哈真香~。

1.定义变量

安装tomcat启动出现Neither the JAVA_HOME nor the JRE_HOME environment variable is defined

安装tomcat启动出现Neither the JAVA_HOME nor the JRE_HOME environment variable is defined

设置成下面这种形式。

安装tomcat启动出现Neither the JAVA_HOME nor the JRE_HOME environment variable is defined

2.在path变量里面添加环境变量

安装tomcat启动出现Neither the JAVA_HOME nor the JRE_HOME environment variable is defined

安装tomcat启动出现Neither the JAVA_HOME nor the JRE_HOME environment variable is defined

3.把命令行界面关闭再重新打开,输入startup就可以了

安装tomcat启动出现Neither the JAVA_HOME nor the JRE_HOME environment variable is defined

 

安装tomcat启动出现Neither the JAVA_HOME nor the JRE_HOME environment variable is defined

 

4.不要关闭上面tomcat页面,最后浏览器输入一下 http://localhost:8080 ,成功!

安装tomcat启动出现Neither the JAVA_HOME nor the JRE_HOME environment variable is defined