Linux BASEDIR 环境变量未正确定义
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6125249/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
The BASEDIR environment variable is not defined correctly
提问by Ashish Sharma
While running my tomcat the following error is coming .
运行我的 tomcat 时出现以下错误。
The BASEDIR environment variable is not defined correctly
This environment variable is needed to run this program
BASEDIR 环境变量未正确定义
运行此程序需要此环境变量
Dec 23, 2009 1:03:22 PM org.apache.jk.server.JkMain start INFO: Jk running ID=0 time=1/41 config=null
2009 年 12 月 23 日下午 1:03:22 org.apache.jk.server.JkMain 启动信息:Jk 运行 ID=0 时间=1/41 config=null
This is how I set my JAVA_PATH in my bashrc file
这就是我在 bashrc 文件中设置 JAVA_PATH 的方式
export JAVA6_HOME=/home/asharma/Softwares/jdk1.6.0_12
export JAVA_HOME=$JAVA6_HOME
export JPDA_TRANSPORT=dt_socket
export JPDA_ADDRESS=9000
export RESIN_HOME=/home/asharma/Softwares/resin
export PATH JAVA_HOME
export GDK_NATIVE_WINDOWS=1
export CATALINA_HOME=/home/asharma/Softwares/apache-tomcat-6.0.20
export CATALINA_OPTS="-Dcom.sun.management.jmxremote Dcom.sun.management.jmxremote.port=19000 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false"
export CATALINA_OPTS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9998 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false"
alias tstart="$CATALINA_HOME/bin/catalina.sh jpda start -Xmx2000m -Dcom.sun.management.jmxremote.port=9998 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false ; tail -f $CATALINA_HOME/logs/catalina.out"
alias tstop="sh $CATALINA_HOME/bin/shutdown.sh"
alias minstall='mvn clean install -Dhttps.proxyHost=monitoring01.hyd.int.untd.com -Dhttps.proxyPort=3128'
alias resin='sh $RESIN_HOME/bin/httpd.sh -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=12345 -Dcom.sun.management.jmxremote.port=9999 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -verbose -DVPS_HOME=/home/asharma/vps -Xms2000m -Xmx2000m'
采纳答案by NinjaBoy
I had the same problem and this worked for me.
我有同样的问题,这对我有用。
Try this:
尝试这个:
Go to the your path-to-tomcat/bin in the terminal
转到终端中的 to-tomcat/bin 路径
Then execute the command below:
然后执行下面的命令:
chmod +x *.sh
Then run tomcat using ./startup.sh
然后使用运行 tomcat ./startup.sh
回答by Thadp
I had this issue in windows 7 with a new installation of tomcat, after about 30 minutes of looking i wanted to see where the error was and opened up the classpath.bat file to see a variable named BASEDIR. I tried all the different things people suggested to no avail. The simple solution i found..
我在新安装的 tomcat 的 Windows 7 中遇到了这个问题,经过大约 30 分钟的查找,我想查看错误所在并打开 classpath.bat 文件以查看名为 BASEDIR 的变量。我尝试了人们建议的所有不同的东西都无济于事。我发现的简单解决方案..
open startup.bat add
打开startup.bat添加
set BASEDIR=d:\tomcat
设置 BASEDIR=d:\tomcat
or whatever your tomcat base folder is to the line right after @echo off (this is the first line in the file)
或者任何你的 tomcat 基本文件夹在@echo off 之后的那一行(这是文件中的第一行)
回答by Freeman
I solved it using sudo
:
我使用sudo
以下方法解决了它:
sudo ./startup.sh
回答by Geln Yang
I have same problem and have resolved it. There is another tomcat and have CATALINA_HOME setting in /etc/profile, when the new tomcat starts, the CATALINA_HOME redirect to old tomcat home, where the new tomcat starting user doesn't have permission to execute.
我有同样的问题并已解决。还有一个tomcat,在/etc/profile中有CATALINA_HOME设置,新tomcat启动时,CATALINA_HOME重定向到老tomcat home,新tomcat启动用户没有权限执行。
Just, add the setting "export CATALINA_HOME=" to the new tomcat home at the beginning of the startup.sh script.
只需在startup.sh 脚本的开头将设置“export CATALINA_HOME=”添加到新的tomcat home 中即可。
回答by Debasis
For me the problem occurs because I have different versions of apache tomcat installed. In particular, you get this error if you are trying to invoke a newer version of the web-server, with the CATALINE_HOME pointed to an older version. A quick fix, which worked for me, is to set the CATALINA_HOME environment variable to the version you are trying to invoke.
对我来说,出现问题是因为我安装了不同版本的 apache tomcat。特别是,如果您尝试调用较新版本的 Web 服务器,并且 CATALINE_HOME 指向较旧版本,则会出现此错误。对我有用的快速修复是将 CATALINA_HOME 环境变量设置为您尝试调用的版本。