我已经按照本教程(http://www.mulesoft.com/tomcat-linux#.URj9weCy1Nh)使用以下环境变量在debian wheezy上安装tomcat:
Using CATALINA_BASE: /usr/local/apache-tomcat-7.0.35
Using CATALINA_HOME: /usr/local/apache-tomcat-7.0.35
Using CATALINA_TMPDIR: /usr/local/apache-tomcat-7.0.35/temp
Using JRE_HOME: /usr/lib/jvm/java-6-openjdk-amd64/jre
Using CLASSPATH: /usr/local/apache-tomcat-7.0.35/bin/bootstrap.jar:/usr/local/apache- tomcat-7.0.35/bin/tomcat-juli.jar
我给了tomcat用户一个bash登录名,当我运行./startup.sh时没有任何反应,没有端口打开。运行version.sh给了我:
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/catalina/util/ServerInfo
Caused by: java.lang.ClassNotFoundException: org.apache.catalina.util.ServerInfo
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
找不到主类:org.apache.catalina.util.ServerInfo。程序将退出。
缺少什么想法?
答案 0 :(得分:2)
JDK from Oracle (SUN) or IBM
JAVA_HOME
环境变量设置为的根目录
兼容的JDK $
JAVA_HOME=/usr/java/jdk1.6.0_01
$
export JAVA_HOME
PATH
的前面
环境变量。
$ PATH=$JAVA_HOME/bin:$PATH
$ export PATH
/usr/bin/java
并将其移开,如下所示:$
cd /usr/java
$
mv java java.moved
$ which java
/usr/java/jdk1.6.0_01/bin/java