Neither the JAVA_HOME nor the JRE_HOME environment variable is defined ;At least one of these enviro
来源:互联网 发布:日本刘姓 知乎 编辑:程序博客网 时间:2024/05/21 11:09
inux下,关闭和重启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以前是正常的,突然重启下tomcat时报了这个错,错误大致是环境变量不可用造成的,
在网上找了很久都是说要修改setclasspath.bat(该文件路径在tomcat的bin目录下)文件;在文件中加入JAVA_HOME和JRE_HOME的环境变量,
我也在该文件中加了如下:
rem Make sure prerequisite environment variables are set
rem In debug mode we need a real JDK (JAVA_HOME)
export JAVA_HOME=/usr/local/jdk1.7.0_79
export JRE_HOME=${JAVA_HOME}/jre
if ""%1"" == ""debug"" goto needJavaHome
rem Otherwise either JRE or JDK are fine
if not "%JRE_HOME%" == "" goto gotJreHome
if not "%JAVA_HOME%" == "" goto gotJavaHome
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
:needJavaHome
rem Check if we have a usable JDK
if "%JAVA_HOME%" == "" goto noJavaHome
if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
if not exist "%JAVA_HOME%\bin\javaw.exe" goto noJavaHome
if not exist "%JAVA_HOME%\bin\jdb.exe" goto noJavaHome
"setclasspath.bat" [dos] 97L, 3509C
保存好文件,再次运行./startup.sh
仍然报错:
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也是正常的,会不会在linux在运行的内存里面丢失了JAVA_HOME和JRE_HOME
的环境变量参数,如果是那样,就重新写入/etc/profile环境变量就ok了。
接着我运行了#source /etc/profile
重新写入profile配置文件
运行#java -version
奇迹出现了
java version "1.7.0_79"
Java(TM) SE Runtime Environment (build 1.7.0_79-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)
切换到tomcat的bin目录下
运行#./startup.sh
tomcat运行成功!
原文地址:http://www.bubuko.com/infodetail-1307842.html
- Neither the JAVA_HOME nor the JRE_HOME environment variable is defined ;At least one of these enviro
- Linux下tomcat启动Neither the JAVA_HOME nor the JRE_HOME environment variable is defined At least one of
- 启动Tomcat异常(Neither the JAVA_HOME nor the JRE_HOME environment variable is defined At least one of )
- tomcat启动时错误Neither the JAVA_HOME nor the JRE_HOME environment variable is defined At least one of th
- Linux下Tomcat启动报错:Neither the JAVA_HOME nor the JRE_HOME environment variable is defined At least one
- Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
- Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
- Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
- Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
- Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
- Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
- Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
- Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
- Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
- 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 的解决方案
- Neither the JAVA_HOME nor the JRE_HOME environment variable is defined 错误解决
- jkd7、tomcat7安装详解。Neither the JAVA_HOME nor the JRE_HOME environment variable is defined 错误解决
- redisz 做消息传递
- ARM7 的启动
- Windows 配置Apache虚拟机
- vc++ TCP/IP网络编程中recv的含义
- C# 网络编程(一)
- Neither the JAVA_HOME nor the JRE_HOME environment variable is defined ;At least one of these enviro
- 前端面试大全(一)
- tools下找不到draw9patch.bat
- NAO机器人系统下模块生成和python模块调用
- POM文件org.apache.maven.archiver.MavenArchiver.getManifest错误
- div内容居中
- 6张思维导图搞定html、css(画QQ企鹅)
- HDU 1052 田忌赛马(贪心)
- 简单地文件输入\输出