windows中修改catalina.sh上传到linux执行报错This file is needed to run this program解决

  windows中修改catalina.sh上传到linux执行报错This file is needed to run this program解决

    一、发现问题

    由于tomcat内存溢出,在windows下修改了catalina.sh,然后通过ssh传到linux服务器上,执行catalina.sh时出现如下错误:

    Cannot find ./catalina.sh

    This file is needed to run this program

    二、尝试解决

    使用sh catalina.sh命令执行,结果没有设置javahome,然后在catalina.sh里面添加:JAVA_HOME=/usr/lib/jvm/jdk1.5.0_16; 再次执行sh catalina.sh,错误如下:

    The BASEDIRenvironmentvariable is not defined correctly

    This environmentvariable is needed to run this program

    三、解决方案

    .sh文件都不是可执行文件,于是找到命令:chmod +x *.sh,这个命令的意思是让所有的.sh文件都可执行。再次执行sh catalina.sh通过,然后用sh startup.sh成功启动。

原文地址:https://www.cnblogs.com/shanheyongmu/p/5774989.html