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 environment variable is defined At least one of these environment variable is needed to run this program。
解决方式:
在setclasspath.bat的开头声明环境变量。如图所示:
先看Tomcat的startup.bat,它调用了catalina.bat,而catalina.bat则调用了setclasspath.bat。只要在setclasspath.bat的开头声明环境变量,如我的就是:
rem ---------------------------------------------------------------------------
rem Set CLASSPATH and Java options
rem
rem $Id: setclasspath.bat 505241 2007-02-09 10:22:58Z jfclere $
rem ---------------------------------------------------------------------------
set JAVA_HOME=E:\Java\jdk1.8.0_151
set JRE_HOME=E:\Java\jre8
rem Make sure prerequisite environment variables are set
if not "%JAVA_HOME%" == "" goto gotJdkHome
if not "%JRE_HOME%" == "" goto gotJreHome
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
......
这样在每次运行startup.bat时就注册了JAVA_HOME,JRE_HOME。控制台窗口关闭后,这两个变量也将消失,不会再占用内存
linux系统:
在tomcat的bin目录下,编辑catalina.sh文件,加入
export JAVA_HOME=/usr/local/java/jdk1.8.0_151
export JRE_HOME=/usr/local/java/jdk1.8.0_151/jre
这两行,重新启动就正常!
本章完,个人经验记录,仅供参考!
白驹过隙,当看到比你优秀的人比你还努力的时候,你也会越来越优秀,相信越努力越幸运!
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 definedtemp
catalina.sh 加入环境 export JAVA_HOME=/usr/local/jdk1.7.0_79 export CATALINA_HOME=/home/sa/webserver/tom ...
- 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 this program
Tomcat使用的是https://tomcat.apache.org/download-90.cgi Tomcat9 之前安装的JDK 13,有JAVA_HOME环境变量地址(C:\Program ...
- 普通用户操作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 ...
- 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 ...
- 启动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 ...
- 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 ...
- 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 ...
- 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 ...
- linux安装tomcat Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
这两天我们的开发机重启了好几次,发现每次重启后我的tomcat总是没有启动.检查java路径,配置正确,后来拿普通账号启动tomcat时报如下的错: Neither the JAVA_HOME nor ...
随机推荐
- 纯CSS写的各种小三角和小箭头
头朝下的小三角 width:0; height:0; border:50px solid transparent; //所有border都是透明的, border-top-color:black; / ...
- 「JOISC 2016 Day 3」回转寿司
https://loj.ac/problem/2736 题解 挺有意思的题. 考虑这种操作不好直接维护,还有时限比较长,所以考虑分块. 考虑一个操作对整个块的影响,无非就是可能把最大的拿走,再把新的元 ...
- [CF1093E]Intersection of Permutations:树套树+pbds
分析 裸的二维数点,博主用树状数组套平衡树写的,顺便pbds真好用. Update on 2018/12/20:再解释一下为什么是二维数点,第一维是\(la \leq i \leq ra\),第二维是 ...
- spring boot 集成 mybatis 单元测试Dao层 控制台报错:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):
最近帮同学做毕业程序,采用后端spring boot + mybatis + H2,将框架搭好进行各层的单元测试时,在dao层就出现了错,如图 于是在网上找各种资料,有的说是xml文件和接口没有一一对 ...
- 对象转json串.
public static Object returnObject(String jsonStr, Class objClass) {if (jsonStr == null) {return null ...
- Linux shell - ps,wc命令用法
例1. 查看Oracle数据库活动进程LOCAL=NO,输出行数 oracle@sha> ps -ef|grep LOCAL=NO|wc -l 15 解释:ps -ef是查看所有的进程的 然后用 ...
- 2018-2019-2 20175214 实验三《敏捷开发与XP实践》实验报告
一.实验内容 1.编码标准:在IDEA中使用工具(Code->Reformate Code)把下面代码重新格式化,再研究一下Code菜单,找出一项让自己感觉最好用的功能.提交截图,加上自己学号水 ...
- 【洛谷P2239 螺旋矩阵】
题目链接 直接看题 一看就很数学 我们不妨来画图 画出几个矩阵,找他们的关系 然后发现 当i==1时,对应的值就是j所对应的值: 当i==n时,所对应的值就是3*n-2-j+1: 当j==1时,所对应 ...
- tikz: keep in mind these
don't add % in title, xlabel, ylabel etc., use \%
- 封装redis(set/get/delete)str和哈希类型
将Redis的常用操作封装了一下: import redis class MyRedis(): def __init__(self,ip,passwd,port=6379,db=0): #构造函数 t ...