一眼就能看出来是jdk的环境有问题,但是用了这么久的jdk一直都配置的好好的,怎么一到Tomcat上就这么矫情了。
最后查解决方案,原来是我的jdk从官网直接下载的,虽然我修改了java_home,但不太智能的tomcat仍然没有自动识别出java_home路径。

linux解决方法:

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

1 export JAVA_HOME=/usr/local/jdk
2 export JRE_HOME=/usr/local/jdk/jre
修改后大概是下面的样子

01 # $Id: catalina.sh 1202062 2011-11-15 06:50:02Z mturk $
02 # -----------------------------------------------------------------------------
03
04 export JAVA_HOME=/usr/local/jdk
05 export JRE_HOME=/usr/local/jdk/jre
06
07 # OS specific support. $var must be set to either true or false.
08 cygwin=false
09 darwin=false
10 os400=false
11 case "uname" in
12 CYGWIN) cygwin=true;;
13 Darwin
) darwin=true;;
14 OS400*) os400=true;;
15 esac .....................

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

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的更多相关文章

  1. 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 ...

  2. 普通用户操作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 ...

  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. JRE_HOME environment variable is not defined correctly This environment variableis needed to run this program

    已经安装了JDK1.7 和对应JRE 安装了tomcat8 都是解压版 并设置了JAVA_HOME.JRE_HOME 但Tomcat在启动过程中找不到 错误: the JRE_HOME environ ...

  5. Cannot find tomcat目录/bin/setclasspath.sh This file is needed to run this program

    首先如果直接使用 root 用户来启动 tomcat 的话,是可以正常启动的. 但是我们在 Linux 中使用普通用户启动 tomcat 报了如下错误 Cannot find /developer/a ...

  6. Tomcat启动报错:This file is needed to run this program

    Tomcat版本为 8.5.29. 1.情景 kill调用tomcat进程后,重启tomcat报如下错误: Cannot find /usr/local/apache-tomcat-/bin/setc ...

  7. linux下启动tomcat出现“This file is needed to run this program ”

    使用sh startup.sh启动tomcat 出现This file is needed to run this program 原因.sh文件都不是可执行文件,于是找到命令: chmod +x * ...

  8. 启动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的startup.bat,它调用了catalina.bat,而catalina.bat则调用了setclasspath.bat.只要在setclasspath.b ...

  9. 解决Linux下启动Tomcat遇到Neither the JAVA_HOME nor the JRE_HOME environment variable is defined

    找到启动路径所在的目录: cd bin/ vi catalina.sh 加入以下信息: export JAVA_HOME=/home/gongzi/http/jdk1.6.0_26 export JR ...

随机推荐

  1. python3.6 ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__

    Cython emulates Python 2-style implicit relative imports on Python 3 Cython的锅(也就是绝大多数下载安装的python)新的i ...

  2. Linux系统基本常识

    在虚拟机里装一个Linux(centos),有时间可以装个mac玩一下.(使用centos或者Ubuntu时安装软件将会非常方便) ifconfig –a 显示当前Linux主机的 ip 地址 如何让 ...

  3. 原生js实现倒计时

    html代码: <div class="box">距离下班还有:<span>01:01:30</span></div> css代码: ...

  4. Ubuntu解压缩zip,tar,tar.gz,tar.bz2文件命令

    tar解包:tar xvf FileName.tar打包:tar cvf FileName.tar DirName .gz解压1:gunzip FileName.gz解压2:gzip -d FileN ...

  5. Coconuts, Revisited(递推+枚举+模拟)

    Description The short story titled Coconuts, by Ben Ames Williams, appeared in the Saturday Evening ...

  6. Oracle11g温习-第八章:归档日志

    2013年4月27日 星期六 10:36 1.归档和非归档的区别 1)  归档会在日志切换时,备份历史日志,用于OLTP(在线事务处理系统),可以进行冷备份和热备份,可以实现数据库完全恢复.不完全恢复 ...

  7. 42. Trapping Rain Water *HARD*

    Given n non-negative integers representing an elevation map where the width of each bar is 1, comput ...

  8. 自定义Spark Partitioner提升es-hadoop Bulk效率

    http://www.jianshu.com/p/cccc56e39429/comments/2022782 和 https://github.com/elastic/elasticsearch-ha ...

  9. forget word out4

    1★ be 使~ 成为:   2★ bene bene   3★ bi 2,两个,双重   4★ by 在~ 旁边,副的  

  10. VS2010创建动态链接库(DLL)的方法

    1.第一步创建WIN32项目,选择DLL 2.第二步,创建你自己的DLL CPP文件和头文件,下面以两个简单的加减法函数为例子导出 然后编译生成即可.DLL文件在Debug或Release目录中 .d ...