我已经按照本教程(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。程序将会退出。
任何想法缺少什么?
JDK from Oracle (SUN) or IBM
JAVA_HOME
$JAVA_HOME=/usr/java/jdk1.6.0_01 $ export JAVA_HOME
$JAVA_HOME=/usr/java/jdk1.6.0_01
JAVA_HOME=/usr/java/jdk1.6.0_01
$ export JAVA_HOME
export JAVA_HOME
PATH
$ PATH=$JAVA_HOME/bin:$PATH $ export PATH
$ PATH=$JAVA_HOME/bin:$PATH
$ export PATH
/usr/bin/java
$cd /usr/java $mv java java.moved
$cd /usr/java
cd /usr/java
$mv java java.moved
mv java java.moved
$ which java /usr/java/jdk1.6.0_01/bin/java
$ which java
/usr/java/jdk1.6.0_01/bin/java