从别的地方复制了一个tomcat, 启动后一闪即退, 使用记事本打开 startup.bat文件, 在文件底部修改, 并追加如下内容

call "%EXECUTABLE%" run %CMD_LINE_ARGS%    注意这里的run 本来是start :end 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_HOME的; 那就看起来不是环境变量的问题了

打开bin目录下的Catalina.bat文件, 在下面添加:

rem Copy CATALINA_BASE from CATALINA_HOME if not defined  红色的字是添加的set JAVA_HOME=C:/Program Files (x86)/Java/jdk1.8.0_91
set JRE_HOME=C:/Program Files (x86)/Java/jdk1.8.0_91/jreif not "%CATALINA_BASE%" == "" goto gotBase
set "CATALINA_BASE=%CATALINA_HOME%"
:gotBase

然后重启即可; 如果是linux系统将set 使用  export 替换即可

转载于:https://www.cnblogs.com/wxylog/p/8653215.html

解决JAVA_HOME nor the JRE_HOME environment variable is defined相关推荐

  1. 解决Neither the JAVA_HOME nor the JRE_HOME environment variable is defined问题

    问题描述: 在cmd窗口使用 startup 命令启动Tomcat时,出现 Neither the JAVA_HOME nor the JRE_HOME environment variable is ...

  2. 解决Neither the JAVA_HOME nor the JRE_HOME environment variable is defined At least one of these...问题

    文章目录 1. 复现问题 2. 分析问题 3. 解决问题 4. 总结问题 1. 复现问题 今天把前端项目部署到本地tomcat下,在双击startup.bat时的弹框一闪而过,但不知道问题出现在哪里. ...

  3. Tomcat服务器环境配置--查看bat文件(解决Neither the JAVA_HOME nor the JRE_HOME environment variable is defined问题)

    1. Tomcat环境配置 环境变量配置,博主以为无非就是在系统变量[path]中加上Tomcat目录的bin文件夹路径呗,然后上网一搜,果然就是配置Tomcat的bin目录和lib目录,于是在系统变 ...

  4. Neither the JAVA_HOME nor the JRE_HOME environment variable is defined 完美解决(tomcat error)

    error: Linux下启动和关闭tomcat报错,如下图所示: Neither the JAVA_HOME nor the JRE_HOME environment variable is def ...

  5. linux安装tomcat Neither the JAVA_HOME nor the JRE_HOME environment variable is defined

    这两天我们的开发机重启了好几次,发现每次重启后我的tomcat总是没有启动. 检查java路径,配置正确,后来拿普通账号启动tomcat时报如下的错: 1 Neither the JAVA_HOME ...

  6. Neither the JAVA_HOME nor the JRE_HOME environment variable is defined

    Centos7.5  启动tomcat报错 报错: Neither the JAVA_HOME nor the JRE_HOME environment variable is defined At ...

  7. 解决问题:Neither the JAVA_HOME nor the JRE_HOME environment variable is defined

    错因: 没有定义JAVA_HOME 也没有jre 环境变量配置 也就是说,我们没有配置好jdk的环境变量 在双击启动apache-tomcat-8.5.31\bin\startup.bat 时,出现 ...

  8. pssh批量执行启动tomcat报错:Neither the JAVA_HOME nor the JRE_HOME environment variable is defined

    文章目录 问题描述 问题分析 解决问题 问题描述 我这边一共4台主机,4台主机tomca路径一致.我想想通过pssh命令工具直接将4台主机的tomcat启动,命令如下: [root@hadoop-ma ...

  9. jenkins 远程启动tomcat报错:Neither the JAVA_HOME nor the JRE_HOME environment variable is defined

    异常现象: jenkins 远程启动tomcat报错:Neither the JAVA_HOME nor the JRE_HOME environment variable is defined 解决 ...

最新文章

  1. 交换机SHOW命令,不知道路由器可以参考不·
  2. oracle分组聚合查询,Oracle中分组查询group by用法规则解析
  3. Qt的index 用方法static_castCTableItem*(index.internalPointer())取出来的值的成员都未初始化...
  4. lenovo 一键恢复6.0 NOVO下密码遗忘的解决方案
  5. ASP.NET MVC Caching with OutputCache
  6. SSH2 后端编程思路总结
  7. Linux下安装amsn
  8. 【网站源码】3D元素周期表源码
  9. 10、I/O 输入输出流
  10. 【E类】Linux视频课程集
  11. error CS0246: 未能找到类型或命名空间名“A”(是否缺少 using 指令或程序集引用?)
  12. C讲坛之猜数字游戏的实现
  13. CISCO 关闭4786端口解决方法 cisco IOS and IOS XE software Smart Install protocol Misuse
  14. java:文本域的简单使用
  15. 数据驱动VR流体仿真技能
  16. 线程池的好处,详解,单例(绝对好记)
  17. 新品发布 | P600准行业无人机研发平台,室外视觉识别跟踪、激光雷达避障、多机组网!
  18. 微信小程序5——小程序网络数据请求
  19. 简述寄存器种类及其功能
  20. 2021上海物联网大会总结

热门文章

  1. 修改hostname有几种方式?(转)
  2. CodeForces 362B Petya and Staircases
  3. Linux命令之查找
  4. 三阶魔方中心块调整配方和记忆方法
  5. jeecms v9导入myeclipse 2015 ehcache.xml报错问题
  6. 【WXS数据类型】Boolean
  7. jquery分页插件的修改
  8. MFC窗口程序显示命令行输出窗口的方法
  9. 2-1 git合并 打tag
  10. [软件测试_LAB1]安装junit和hamcrest及其使用