Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
来源:互联网 发布:双色球的算法和技术 编辑:程序博客网 时间:2024/05/31 19:03
======================================================
注:本文源代码点此下载
======================================================
对于使用ide开发的程序员来讲,并不是所有人都对自己用来吃饭的工具了如指掌。常在阴沟跑,哪能不翻船。为此我把自己使用tomcat/eclipse的一些经验教训整理了一下,会陆续的贴出来,也许会帮到和我遇到同样问题的人。
先讲一个tomcat的问题。很多人兴冲冲的下载了一个tomcat,跑到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。好,再去下载个最新版本的jdk,install完成之后却还是提示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的学习热情冷了一半。
原因是后来较新版本的jdk(例如我使用的jdk1.6)安装完不会自动登记环境变量java_home,jre_home。像我在单位的环境,我的用户是受限制的(poweruser),不方便设环境变量,于是我就找到了另外一个方法。
先看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=d:\java\jdk1.6.0_11
set jre_home=d:\java\jre6
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。控制台窗口关闭后,这两个变量也将消失,不会再占用内存。运行一下,最终提示“信息:server startup in xxxxx ms”就大功告成了。
======================================================
在最后,我邀请大家参加新浪APP,就是新浪免费送大家的一个空间,支持PHP+MySql,免费二级域名,免费域名绑定 这个是我邀请的地址,您通过这个链接注册即为我的好友,并获赠云豆500个,价值5元哦!短网址是http://t.cn/SXOiLh我创建的小站每天访客已经达到2000+了,每天挂广告赚50+元哦,呵呵,饭钱不愁了,\(^o^)/
- 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 错误解决
- linux安装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 defined
- windows 与linux出现 Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
- linux安装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 defined
- delphi 通过线程实现Windows服务
- ASP.NET AJAX客户端编程之旅(七)——剩下的问题(完结篇)
- AJAX Control Toolkit tabs 的纯Javascript演示
- Delphi中MessageBox用法
- java环境变量的设置
- Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
- Delphi面向对象学习随笔三:overload与override(转)
- java中的集合
- frank.net
- AjaxControlToolkit 微软出的ajax.net 工具使用教程一
- 使用Delphi快速开发ActiveX控件
- html页面+ashx添加邮箱附件(上传文件)
- ASP.NET AJAX RC1.0 的一点变化
- HTML页面跳转的5种方法