`
cisayou
  • 浏览: 16889 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论

tomcat Neither the JAVA_HOME nor the JRE_HOME environment variable is defined

    博客分类:
  • IDE
 
阅读更多

error:

Linux下启动和关闭tomcat报错,如下图所示:



 

 

这两天我们的开发机重启了好几次,发现每次重启后我的tomcat总是没有启动。
原来是我使用的jdk不是通过yum安装的,是我从官网直接下载的,虽然我修改了java_home,但不太智能的tomcat仍然没有自动识别出java_home路径。

解决方法:
编辑文件 /usr/local/apache-tomcat-8.5.29/bin/catalina.sh (根据你自己的jdk路径进行修改) 在文件的正文开头,即正式代码前,大概在99行添加如下代码

export JAVA_HOME=/usr/local/java/jdk1.8.0_161
export JRE_HOME=/usr/local/java/jdk1.8.0_161/jre

 

注意:Windows下请修改对应的 catalina.bat

 

  • 大小: 22.2 KB
分享到:
评论

相关推荐

    Kubuntu下安装配置Tomcat

    错误1: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 错误2: Neither the JAVA_HOME nor the JRE_HOME ...

    windows下直接点击startup.bat启动tomcat服务.docx

    然而,有时可能会遇到一些问题,比如本文档中提到的情况,即在已经安装并配置好JDK的情况下,Tomcat无法正常启动,并抛出错误提示:“Neither the JAVA_HOME nor the JRE_HOME environment variable is defined”。...

    Tomcat安装图解

    如果遇到找不到`JAVA_HOME`路径的问题,即出现类似“Neither the JAVA_HOME nor the JRE_HOME environment variable is defined”的错误,你需要设置`JAVA_HOME`环境变量。假设你的JDK安装在`/usr/java/jdk1.6.0_16`...

    tomcat启动问题

    echo Neither the JAVA_HOME nor the JRE_HOME environment variable is defined echo At least one of these environment variables is needed to run this program goto exit ``` 这段代码检查了`JAVA_HOME`...

    Linux实战总结

    - 错误示例:“Neither the JAVA_HOME nor the JRE_HOME environment variable is defined” 表明没有设置`JAVA_HOME`或`JRE_HOME`环境变量。 - 解决方法:手动设置`JAVA_HOME`环境变量,并确保路径正确。 ```...

    Windows t和linux下无法启动Tomcat解决方案

    在Windows环境中,无法启动Tomcat通常表现为以下错误:“Neither the JAVA_HOME nor the JRE_HOME environment variable is defined”。这个错误意味着系统找不到配置的Java开发工具包(JDK)或Java运行环境(JRE)...

    在LINUX下安装JDK1.6

    如果在启动Tomcat时遇到类似“`Neither the JAVA_HOME nor the JRE_HOME environment variable is defined`”的错误提示,这是因为Tomcat没有找到有效的JDK或JRE环境。解决方法是在启动Tomcat之前设置`JAVA_HOME`...

    tomcat启动startup.bat一闪而过问题的解决方法【亲测有效】

    6. 常见错误信息及解决方案:如果遇到错误提示“Neither the JAVA_HOME nor the JRE_HOME environment variable is defined”,说明Tomcat找不到相应的Java环境变量。此时,需要在setclasspath.bat文件中手动声明...

Global site tag (gtag.js) - Google Analytics