tomcat 无法在 linux 机器上启动

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4515518/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-05 02:17:11  来源:igfitidea点击:

tomcat wont start up on linux machine

javalinuxtomcat

提问by David

I'm new to Linux but having spent a whole day I Installed Java and Tomcat. My goal is to host an App with this Linux box. I know it all works fine from my windows based machine, but it is my laptop so I'm planning to use the Linux Box as my dedicated server.

我是 Linux 新手,但花了一整天时间安装了 Java 和 Tomcat。我的目标是用这个 Linux 机器托管一个应用程序。我知道在我的基于 Windows 的机器上一切正常,但它是我的笔记本电脑,所以我计划使用 Linux Box 作为我的专用服务器。

Following many many forums I've now got Tomcat 7 installed. However i cannot get it to start.

在许多论坛之后,我现在已经安装了 Tomcat 7。但是我无法让它开始。

Changing to the tomcat directory and "./startup.sh" i get the following output:

更改到 tomcat 目录和“./startup.sh”,我得到以下输出:

Using CATALINA_BASE: /usr/local/tomcat
Using CATALINA_HOME:  /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME: usr/lib/jvm/java-6-sun/
Using CLASSPATH: /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar

That's the end of the output.

这就是输出的结束。

However localhost:8080 is not up, and in the tomcat log file is the error "eval: 1: usr/lib/jvm/java-6-sun//bin/java: not found"

但是 localhost:8080 没有启动,并且在 tomcat 日志文件中是错误“eval: 1: usr/lib/jvm/java-6-sun//bin/java: not found”

Hopefully there is some expert here who can help me with this problem. Please note that I'm a novice when it comes to Linux.

希望这里有一些专家可以帮助我解决这个问题。请注意,我是 Linux 的新手。

PS: My Linux version is Ubuntu 10.04 LTS - the Lucid Lynx

PS:我的 Linux 版本是 Ubuntu 10.04 LTS - Lucid Lynx

采纳答案by Stephen Denne

JRE_HOME is missing a /at the start of it.

JRE_HOME/的开头缺少一个。

Your CATALINA_HOME and CLASSPATH also looks wrong, with a local.tomcatinstead of a local/tomcatand c\tomcat-juliinstead of tomcat-juli

您的 CATALINA_HOME 和 CLASSPATH 看起来也有问题,用 alocal.tomcat代替 alocal/tomcatc\tomcat-juli代替tomcat-juli

回答by mikevdg

Try typing this on the command line:

尝试在命令行中输入:

$ export CATALINA_HOME=/usr/local/tomcat
$ export JRE_HOME=/usr/lib/jvm/java-6-sun
$ /usr/local/tomcat/bin/catalina.sh run

This will run Tomcat in the terminal you have open, so you can watch it do stuff. Press CTRL+C to quit it.

这将在您打开的终端中运行 Tomcat,因此您可以观看它做的事情。按 CTRL+C 退出。

回答by Genadinik

When I encountered something similar, the problems was with my Tomcat7 installation. I downgraded to Tomcat6 and it started working perfectly.

当我遇到类似的事情时,问题出在我的Tomcat7安装上。我降级到 Tomcat6,它开始完美运行。

回答by wilbert

  1. First download the Linux tomcat version.
  2. Unzip it.
  3. Go to the tomcat bin folder.
  4. Run the startup.sh for start the tomcat server
  5. Shutdown.sh for using to stop the tomcat
  1. 首先下载Linux tomcat版本。
  2. 解压它。
  3. 转到 tomcat bin 文件夹。
  4. 运行 startup.sh 以启动 tomcat 服务器
  5. Shutdown.sh 用于停止 tomcat

see the link, http://brigitzblog.blogspot.com/2011/11/linux-how-can-i-startstop-tomcat-server.html

见链接, http://brigitzblog.blogspot.com/2011/11/linux-how-can-i-startstop-tomcat-server.html

回答by The Unknown Dev

I'm just posting in case this will help someone else. I had my JAVA_HOMEset to

我只是发布以防这对其他人有帮助。我有我的JAVA_HOME设置

/usr/lib/jvm/java-7-openjdk-i386/jre/bin/java

/usr/lib/jvm/java-7-openjdk-i386/jre/bin/java

I should have been

我应该是

/usr/lib/jvm/java-7-openjdk-i386/jre

/usr/lib/jvm/java-7-openjdk-i386/jre

without the /bin/javapart at the end. This is because will look for bin/javain that path already and you don't need to specify it.

没有最后的/bin/java部分。这是因为将bin/java在该路径中查找并且您不需要指定它。