error:
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.bat的开头声明环境变量,打开tomcat的bin目录下面的setclasspath.sh,添加红色部分,路径自己修改
#!/bin/sh
# -----------------------------------------------------------------------------
# Set CLASSPATH and Java options
#
# $Id: setclasspath.sh 467182 2006-10-23 23:47:06Z markt $
# -----------------------------------------------------------------------------
export JAVA_HOME=/usr/lib/jvm/java-6-sun
export JRE_HOME=/usr/lib/jvm/java-6-sun/jre
# First clear out the user classpath
CLASSPATH=
# Make sure prerequisite environment variables are set
if [ -z "$JAVA_HOME" -a -z "$JRE_HOME" ]; then
# Bugzilla 37284
if $darwin && [ -d "/System/Library/Frameworks/JavaVM.framework/Versions/1.5/Home" ]; then
export JAVA_HOME="/System/Library/Frameworks/JavaVM.framework/Versions/1.5/Home"
else
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"
exit 1
fi
fi
if [ -z "$JAVA_HOME" -a "$1" = "debug" ]; then
echo "JAVA_HOME should point to a JDK in order to run in debug mode."
exit 1
fi
if [ -z "$JRE_HOME" ]; then
JRE_HOME="$JAVA_HOME"
fi
# If we're running under jdb, we need a full jdk.
if [ "$1" = "debug" -o "$1" = "javac" ] ; then
if [ "$os400" = "true" ]; then
if [ ! -x "$JAVA_HOME"/bin/java -o ! -x "$JAVA_HOME"/bin/javac ]; then
echo "The JAVA_HOME environment variable is not defined correctly"
echo "This environment variable is needed to run this program"
echo "NB: JAVA_HOME should point to a JDK not a JRE"
exit 1
fi
else
if [ ! -x "$JAVA_HOME"/bin/java -o ! -x "$JAVA_HOME"/bin/jdb -o ! -x "$JAVA_HOME"/bin/javac ]; then
echo "The JAVA_HOME environment variable is not defined correctly"
echo "This environment variable is needed to run this program"
echo "NB: JAVA_HOME should point to a JDK not a JRE"
exit 1
fi
fi
fi
if [ -z "$BASEDIR" ]; then
echo "The BASEDIR environment variable is not defined"
echo "This environment variable is needed to run this program"
exit 1
fi
if [ ! -x "$BASEDIR"/bin/setclasspath.sh ]; then
if $os400; then
# -x will Only work on the os400 if the files are:
# 1. owned by the user
# 2. owned by the PRIMARY group of the user
# this will not work if the user belongs in secondary groups
eval
else
echo "The BASEDIR environment variable is not defined correctly"
echo "This environment variable is needed to run this program"
exit 1
fi
fi
# Set the default -Djava.endorsed.dirs argument
JAVA_ENDORSED_DIRS="$BASEDIR"/endorsed
# Set standard CLASSPATH
if [ "$1" = "debug" -o "$1" = "javac" ] ; then
CLASSPATH="$JAVA_HOME"/lib/tools.jar
fi
# OSX hack to CLASSPATH
JIKESPATH=
if [ `uname -s` = "Darwin" ]; then
OSXHACK="/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Classes"
if [ -d "$OSXHACK" ]; then
for i in "$OSXHACK"/*.jar; do
JIKESPATH="$JIKESPATH":"$i"
done
fi
fi
# Set standard commands for invoking Java.
_RUNJAVA="$JRE_HOME"/bin/java
if [ "$os400" != "true" ]; then
_RUNJDB="$JAVA_HOME"/bin/jdb
fi
_RUNJAVAC="$JAVA_HOME"/bin/javac
转自:http://linghongli.iteye.com/blog/61530
分享到:
相关推荐
错误1: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 错误2: Neither the JAVA_HOME nor the JRE_HOME ...
在网络安全领域,"Neither_Snow_Nor_Rain_Nor_MITM"这一表述暗示了无论面对何种困难,包括恶劣天气或者中间人攻击(Man-in-the-Middle, MITM),都需要坚决捍卫信息安全。MITM攻击是一种常见的网络威胁,攻击者在...
然而,有时可能会遇到一些问题,比如本文档中提到的情况,即在已经安装并配置好JDK的情况下,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” 表明没有设置`JAVA_HOME`或`JRE_HOME`环境变量。 - 解决方法:手动设置`JAVA_HOME`环境变量,并确保路径正确。 ```...
如果遇到找不到`JAVA_HOME`路径的问题,即出现类似“Neither the JAVA_HOME nor the JRE_HOME environment variable is defined”的错误,你需要设置`JAVA_HOME`环境变量。假设你的JDK安装在`/usr/java/jdk1.6.0_16`...
echo Neither the JAVA_HOME nor the JRE_HOME environment variable is defined echo At least one of these environment variables is needed to run this program goto exit ``` 这段代码检查了`JAVA_HOME`...
在Windows环境中,无法启动Tomcat通常表现为以下错误:“Neither the JAVA_HOME nor the JRE_HOME environment variable is defined”。这个错误意味着系统找不到配置的Java开发工具包(JDK)或Java运行环境(JRE)...
如果在启动Tomcat时遇到类似“`Neither the JAVA_HOME nor the JRE_HOME environment variable is defined`”的错误提示,这是因为Tomcat没有找到有效的JDK或JRE环境。解决方法是在启动Tomcat之前设置`JAVA_HOME`...
17. 否定句的同义表达:"There is ________ water ________ bread on the table.","neither...nor..."表示“既不...也不...”,否定两者。 18. 同义句转换:"We should respect ________ ________.","each other...
It’s Thursday." "neither...nor..."表示两者都不,此处表示既不是周一也不是周二,所以正确答案是C. Neither。 13. 副词ever与never的用法:"Have you ____ heard of the story? - No, ______." "ever"表示曾经...
1. 题目: "Neither he nor I ___ for the plan." 解析: "Neither...nor..." 结构遵循就近原则,即动词应与最近的主语保持一致。这里的"I"是最近的主语,所以用"am"。 答案: d. am 2. 题目: "My family as well as...
题目:Neither you nor I _____ a student.\n 解析:neither...nor...结构遵循就近原则,谓语动词与最近的主语I保持一致,故答案是C. am。\n\n4. 题目:Both of my parents _____ teachers.\n 解析:both...of......
3. 现在分词作定语:"The sunlight ______ hard-edged shadow on the ground"表明阳光投射出阴影,throwing在此处作定语,表示主动进行的状态,所以正确答案是B. throwing。 4. 不定式的完成被动形式:"seemed ____...
Neither, thanks C. Both, please D. I’d love some, thanks 答案: B 10.Mike: How was your driving test? Steve: I failed. I was so nervous that I hit the wrong pedal. Mike: ___________. But you’ll do...
6. 常见错误信息及解决方案:如果遇到错误提示“Neither the JAVA_HOME nor the JRE_HOME environment variable is defined”,说明Tomcat找不到相应的Java环境变量。此时,需要在setclasspath.bat文件中手动声明...
11. **主谓一致** - **就近原则**:"Neither my classmates nor my mother ______ the piano better than me." 第11题,"neither...nor..." 结构遵循就近原则,所以谓语动词与 "my mother" 一致,用单数形式 "plays...
17. 选择题:__ these honors he received a sum of money. 答案:A (Except) except 表示“除了”,在这里指除了这些荣誉外,他还收到了一笔钱。 通过以上题目解析,我们可以看出大学英语统考中对词汇的考察不仅...
One is a teacher, ______ is a doctor." 正确答案是"D.the other",表示两者中的另一个,固定搭配"one...the other..."。 4. 时间状语从句 - 与现在完成时的搭配:"Jack has lived in Beijing ______ he came to...
例如:Neither dad nor mum is at home today. 今天父母都不在家。 需要注意的是,当主语不是同一个人或物时,nor 和 neither 可互换,例如:I don't know, nor do I care. 我不知道,也不关心。但是,当主语是同一...
" 的回答中,因为父母都喜欢"The Reader",所以应该使用"Neither; nor"来表示两者都不。 7. 完形填空:这部分考察学生在上下文中理解单词和短语的能力。题目讲述了一个父亲和女儿在公园的故事,涉及到词汇的选择和...