安装Apache Tomcat [英] Installing Apache Tomcat
问题描述
我已按照本教程进行操作( http://www.mulesoft.com/tomcat-linux #.URj9weCy1Nh )使用以下环境变量在debian wheezy上安装tomcat:
I have followed this tutorial (http://www.mulesoft.com/tomcat-linux#.URj9weCy1Nh) to install tomcat on debian wheezy using the following environment variables:
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会给我:
I have given the tomcat user a bash login and when I run ./startup.sh nothing happens and no port opens. Running version.sh gives me:
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.程序将退出.
Could not find the main class: org.apache.catalina.util.ServerInfo. Program will exit.
有什么想法吗?
推荐答案
- 安装完整且兼容的
JDK from Oracle (SUN) or IBM
- 将您的
JAVA_HOME
环境变量设置为的根目录 兼容的JDK - Install complete, Compatible
JDK from Oracle (SUN) or IBM
- Set your
JAVA_HOME
environment variable to the root directory of the compatible JDK - 将兼容的JDK的bin目录放在
PATH
的前面 环境变量. - Put the compatibale JDK's bin directory on the front of your
PATH
environment variable. - 通常查找不兼容的JDK的Java可执行文件
/usr/bin/java
并将其移开,就像这样: - Find the java executable of the incompatible JDK, usually
/usr/bin/java
and move it out of the way, like this: - 然后,检查以确保您的java可执行文件指向您的JDK 已安装:
- Then, check to make sure your java executable points to the JDK you have installed:
$
JAVA_HOME=/usr/java/jdk1.6.0_01
$ export JAVA_HOME
$ PATH=$JAVA_HOME/bin:$PATH
$ export PATH
$
cd /usr/java
$ mv java java.moved
$ which java
/usr/java/jdk1.6.0_01/bin/java
这篇关于安装Apache Tomcat的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!