一眼就能看出来是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

http://blog.csdn.net/zhangpengyu321/article/details/12144497

配置tomcat参考:

http://blog.csdn.net/ithomer/article/details/7827045

Tomcat Neither the JAVA_HOME nor the JRE_HOME environment variable is defined的更多相关文章

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

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

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

  3. 启动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 ...

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

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

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

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

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

  9. 解决JAVA_HOME nor the JRE_HOME environment variable is defined

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

随机推荐

  1. eclipse新建workspace使用之前workspace的个性配置

    为使新建的workspace(称作A)的配置,比如主题等等,和之前的workspace(称作B)的配置一样: . 关闭eclipse . 将A中.metadata/.plugins目录下所有文件.文件 ...

  2. php - preg_match

    任务:匹配一个函数名或者变量名,如果碰到alpha,numeric,_以外的全部不允许通过. 实验1: <?php //第一个字符不符合就直接退出正则匹配 $str = '%abcscript% ...

  3. could not perform addBatch

    在执行存数据到数据库的操作时,由于增加的ID值小于或等于对应的索引值时会报这个错误

  4. org.hibernate.PropertyNotFoundException: Could not find a getter for employee in class com.itcast.f_hbm_oneToMany.Department

    <hibernate-mapping package="com.itcast.f_hbm_oneToMany"> <class name="Depart ...

  5. eclipse关联源码的方法

    1.在项目的libs目录下,新建一个android-support-v4.jar.properties文件 2.打开android-support-v4.jar.properties,编辑. 输入源码 ...

  6. 安卓获取线程id

    错误的做法: @Override public void onCreate() { mContext = getApplicationContext(); mHandler = new Handler ...

  7. spring 基于XML和注解的两种事务配置方式

    <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.sp ...

  8. linux 守护进程创建流程

    #include <sys/stat.h> #include <fcntl.h> /* Bit-mask values for 'flags' argument of beco ...

  9. 【servlet】 过滤器模板

    EncodingFilter.java package Filter; import java.io.IOException; import javax.servlet.Filter; import ...

  10. php 数据库并发处理

    在并行系统中并发问题永远不可忽视.尽管PHP语言原生没有提供多线程机制,那并不意味着所有的操作都是线程安全的.尤其是在操作诸如订单.支付等业务系统中,更需要注意操作数据库的并发问题. 接下来我通过一个 ...