为什么我无法从命令行启动 Tomcat?
我从tomcat的官方网站下载了tomcat版本7.0.16二进制发行版核心tar.gz到我的ubuntu机器,然后解压下载的文件。
然后,我使用终端命令指定 ~/apache-tomcat-7.0.16/bin
$ 的路径,然后输入 startup
命令,但我得到了 '< strong>startup: command not find' 消息,但是当我使用 linux 命令 ls
时,出现了 startup.bat 和startup.sh位于bin/下。
我也尝试输入startup.bat和startup.sh,返回了相同的消息。为什么我无法从 ubuntu 终端窗口启动我的 tomcat v7?
I downloaded tomcat version 7.0.16 binary distributions core tar.gz from tomcat's official website to my ubuntu machine, then extracted the downloaded file.
Then, I used terminal command to specify the path to ~/apache-tomcat-7.0.16/bin
$ , then I entered startup
command, but I have got 'startup: command not found' message, but when I used linux command ls
, there were startup.bat and startup.sh under bin/.
I also tried to enter startup.bat and startup.sh, the same message returned. Why I can not start my tomcat v7 from ubuntu terminal window??
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
如果您尝试从包含它的目录运行
startup.sh
,则需要在名称前加上./
- 当前目录不在默认情况下PATH
。此外,您还需要.sh
扩展名。所以要么:
或者:
If you're trying to run
startup.sh
from the directory that contains it, you'll need to prefix the name with./
- the current directory is not on thePATH
by default. Also, you'll need the.sh
extension.So either:
Or:
你应该喜欢这样:
sudo chmod +x /Users/yw/Tomcat/bin/*.sh
you should like this:
sudo chmod +x /Users/yw/Tomcat/bin/*.sh
实际上,问题是您的
startup.sh
没有执行权限,这就是您无法启动它的原因。首先检查是否正确,在其中输入./startup.sh
并观察其内容。如果它说“您没有权限”,则通过此命令chmod 777startup.sh
为其授予执行权限。然后尝试启动它。Actually the problem is your
startup.sh
does not have the execute permission that is why you are unable to start it. First check that properly, type./startup.sh
there and observe what it says. If it is saying that "you don't have the permission" then give it execute permission by this commandchmod 777 startup.sh
. Then try to to start it.我用命令做到了:
I did it with command: