从别的地方复制了一个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/jre if not "%CATALINA_BASE%" == "" goto gotBase
set "CATALINA_BASE=%CATALINA_HOME%"
:gotBase

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

解决JAVA_HOME nor the JRE_HOME environment variable is defined的更多相关文章

  1. Java项目启动时候报Neither the JAVA_HOME nor the JRE_HOME environment variable is defined 解决办法

    今天在发布Java项目的时候又遇到    Neither the JAVA_HOME nor the JRE_HOME environment variable is defined  At leas ...

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

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

  3. CentOS Tomcat启动 Neither the JAVA_HOME nor the JRE_HOME environment variable is defined

    链接:http://blog.csdn.net/shangdiyisi/article/details/9477521 [bravoinfo@bravoinfo-hk-01 apache-tomcat ...

  4. Jenkins启动Tomcat时提示Neither the JAVA_HOME nor the JRE_HOME environment variable is defined

      Jenkins构建提示: [SSH] executing...Neither the JAVA_HOME nor the JRE_HOME environment variable is defi ...

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

      windows系统: 部署了一个Tomcat8.5.15,bin目录下startup.bat执行,结果提示Neither the JAVA_HOME nor the JRE_HOME enviro ...

  6. [转]Tomcat----Neither the JAVA_HOME nor the JRE_HOME environment variable is defined

    对于使用IDE开发的程序员来讲,并不是所有人都对自己用来吃饭的工具了如指掌.常在阴沟跑,哪能不翻船.为此我把自己使用Tomcat/Eclipse的一些经验教训整理了一下,会陆续的贴出来,也许会帮到和我 ...

  7. tomcat启动报错:Neither the JAVA_HOME nor the JRE_HOME environment variable is defined At least one of these environment variable

    linux 下 启动tomcat 报: Neither the JAVA_HOME nor the JRE_HOME environment variable is definedAt least o ...

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

    [root@localhost META-INF]# systemctl start tomcat Job for tomcat.service failed because the control ...

  9. 普通用户操作tomcat项目时报: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

    在使用普通用户更新tomcat项目适合出现这个信息,Neither the JAVA_HOME nor the JRE_HOME environment variable is defined At ...

随机推荐

  1. JVM安全退出(如何优雅的关闭java服务)

    https://tech.imdada.cn/2017/06/18/jvm-safe-exit/?utm_source=tuicool&utm_medium=referral 背景 用户:货都 ...

  2. shell编程实例2

    1.vim  read_PERSON.sh 2. #!/bin/bash echo "What is your name?" read PERSON echo "Hell ...

  3. hibernate框架环境搭建与使用

    搭建环境 一.新建一个项目 , 导包   一个是hibernate的jar包,一个是jdbc的jar包 hibernate的jar包 这些jar包全部导入 二.配置Hibernate. 1.建立hib ...

  4. 地图之CoreLocation

    1. 在Info.plist文件中添加下面两句话 NSLocationAlwaysUsageDescription —> 确定定位吗?亲  (或者改参数类型为BOOL类型 值为Y) 请求的授权, ...

  5. 【设计模式】calendar的单例需求和实现

    calendar单例需求: 参数:有default的calendar file 1.如果无实例,无参数调用,取default,检查是否合法,存入实例 2.如果无实例,有参数调用,检查是否合法,存入实例 ...

  6. Redis补充

    Redis补充 (1)redis基本概念 redis是一个key-value存储系统.和Memcached类似,它支持存储的value类型相对更多,包括string(字符串).list(链表).set ...

  7. Android 应用程序窗体显示状态操作(requestWindowFeature()的应用)

     我们在开发程序是经常会需要软件全屏显示.自定义标题(使用按钮等控件)和其他的需求,今天这一讲就是如何控制Android应用程序的窗体显示. 首先介绍一个重要方法那就是requestWindowF ...

  8. Failed to export application

    打包Android项目,遇到Failed to export application的错误提示.如何处理呢 我当时是 在替换图标时   没有完全替换 只替换了 四张drawable_h图片,没有替换上 ...

  9. for-in 的坑

    for-in 循环的下标为字符串,不是数字 var ar=[13,2,13,14]; function isSort(ar){ for(var i in ar){ console.log(i+':'+ ...

  10. 从微软官网下载VS离线安装包的方法

    这里描述是包括所有版本,截图以下载VS2017社区版为例: ①登入VS官网下载页面,选择需要的版本点击下载,下载页点此进入. ②下载完成后,打开下载文件所在文件夹,Windows 8.1及以上版本用户 ...