The file is absent or does not have execute permission

从tomcat官网上下载了apache-tomcat-7.086.zip 进入tomcat/bin目录,执行启动的时候出现如下错误:

The file is absent or does not have execute permission
This file is needed to run this program
复制代码

解决方法:

  • 进入在 tomcat 的bin目录下
  • 执行 chmod +x *.sh 命令
  • 执行 sh catalina.sh 命令
  • 执行 sh startup.sh 命令

代码如下:

GxdeMacBook-Pro:~ Gary$ cd /Users/Gary/Desktop/开发环境/apache-tomcat-7.0.86/bin 
GxdeMacBook-Pro:bin Gary$ chmod +x *.sh
GxdeMacBook-Pro:bin Gary$ sh catalina.sh
Using CATALINA_BASE:   /Users/Gary/Desktop/开发环境/apache-tomcat-7.0.86
Using CATALINA_HOME:   /Users/Gary/Desktop/开发环境/apache-tomcat-7.0.86
Using CATALINA_TMPDIR: /Users/Gary/Desktop/开发环境/apache-tomcat-7.0.86/temp
Using JRE_HOME:        /Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/Home
Using CLASSPATH:       /Users/Gary/Desktop/开发环境/apache-tomcat-7.0.86/bin/bootstrap.jar:/Users/Gary/Desktop/开发环境/apache-tomcat-7.0.86/bin/tomcat-juli.jar
Usage: catalina.sh ( commands ... )
commands:
  debug             Start Catalina in a debugger
  debug -security   Debug Catalina with a security manager
  jpda start        Start Catalina under JPDA debugger
  run               Start Catalina in the current window
  run -security     Start in the current window with security manager
  start             Start Catalina in a separate window
  start -security   Start in a separate window with security manager
  stop              Stop Catalina, waiting up to 5 seconds for the process to end
  stop n            Stop Catalina, waiting up to n seconds for the process to end
  stop -force       Stop Catalina, wait up to 5 seconds and then use kill -KILL if still running
  stop n -force     Stop Catalina, wait up to n seconds and then use kill -KILL if still running
  configtest        Run a basic syntax check on server.xml - check exit code for result
  version           What version of tomcat are you running?
Note: Waiting for the process to end and use of the -force option require that $CATALINA_PID is defined
GxdeMacBook-Pro:bin Gary$ sh startup.sh
Using CATALINA_BASE:   /Users/Gary/Desktop/开发环境/apache-tomcat-7.0.86
Using CATALINA_HOME:   /Users/Gary/Desktop/开发环境/apache-tomcat-7.0.86
Using CATALINA_TMPDIR: /Users/Gary/Desktop/开发环境/apache-tomcat-7.0.86/temp
Using JRE_HOME:        /Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/Home
Using CLASSPATH:       /Users/Gary/Desktop/开发环境/apache-tomcat-7.0.86/bin/bootstrap.jar:/Users/Gary/Desktop/开发环境/apache-tomcat-7.0.86/bin/tomcat-juli.jar
Tomcat started.
复制代码
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值