首先如果直接使用 root 用户来启动 tomcat 的话,是可以正常启动的。

但是我们在 Linux 中使用普通用户启动 tomcat 报了如下错误

Cannot find /developer/apache-tomcat-8.5.50/bin/setclasspath.sh
This file is needed to run this program

原因是没有在 setclasspath.sh 上设置 JAVA_HOME 和 JRE_HOME。

解决办法:

打开 setclasspath.sh

sudo vi setclasspath.sh

然后设置 JAVA_HOME 和 JRE_HOME

然后再使用命令 sudo ./startup.sh 重新启动 tomcat

关闭的话也要使用 sudo ./shutdown.sh 来关闭,否则会报上面的错误

Cannot find tomcat目录/bin/setclasspath.sh This file is needed to run this program的更多相关文章

  1. Tomcat启动报错:This file is needed to run this program

    Tomcat版本为 8.5.29. 1.情景 kill调用tomcat进程后,重启tomcat报如下错误: Cannot find /usr/local/apache-tomcat-/bin/setc ...

  2. 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内存溢出,在wind ...

  3. linux下启动tomcat出现“This file is needed to run this program ”

    使用sh startup.sh启动tomcat 出现This file is needed to run this program 原因.sh文件都不是可执行文件,于是找到命令: chmod +x * ...

  4. Cannot find ./catalina.sh The file is absent or does not have execute permission This file is needed to run this program(问题解决)

    web项目没有打成包,直接放在了linux服务器上. 进入tomcat/bin目录,执行启动的时候出现如下错误: 解决方法: 在tomcat 的bin目录下 执行这条命令chmod +x *.sh   ...

  5. linux篇-tomcat:Cannot find /usr/local/tomcat1/bin/setclasspath.sh

    首先看下报错代码: Cannot find /usr/local/tomcat1/bin/setclasspath.sh This file is needed to run this program ...

  6. 报Cannot find /usr/local/tomcat/bin/setclasspath.sh错误

    错误如下: [root@RSP-DEVWEB03 bin]#sh startup.sh Cannot find /usr/local/tomcat8081/bin/setclasspath.sh Th ...

  7. Tomcat问题之 启动 Cannot find /usr/local/tomcat/bin/setclasspath.sh

    在linux启动startup命令报Cannot find /usr/local/tomcat/bin/setclasspath.sh  使用: unset CATALINA_HOME命令得以解决   ...

  8. 普通用户操作tomcat项目时报:Neither the JAVA_HOME nor the JRE_HOME environment variable is defined At least one of these environment variable is needed to run this program

    在使用普通用户更新tomcat项目适合出现这个信息,Neither the JAVA_HOME nor the JRE_HOME environment variable is defined At ...

  9. linux tomcat 启动报错 Cannot find /etc/bin/setclasspath.sh

    这是由于tomcat/bin/catalina.sh文件中有一个设置变量的方法 $CATALINA_HOME 有的tomcat中需要默认此值 $CATALINA_HOME=tomcat地址

随机推荐

  1. 基于高德开放平台Map Lab的数据可视化

    在Map Lab上创建可视化项目,首先需要添加数据.添加数据有4种方式,分别是: 上传CSV文件添加数据 上传Excel文件添加数据 连接在线数据库添加数据 提供在线数据API添加数据 一.数据上传说 ...

  2. MongoDB 副本集搭建

    搭建mongodb副本集 [root@ mongodb]# cd /u02 [root@ u02]# mkdir -p mongodb/data_2777 [root@ u02]# mkdir -p ...

  3. Lombok认知

    Lombok的简介 Lombok是一款Java开发插件,公司项目到处使用,整体效果很棒,代码更干净.Java开发人员可以节省出重复构建,诸如hashCode和equals这样的方法以及各种业务对象模型 ...

  4. Elasticsearch核心概念

    Elasticsearch 核心概念 Cluster 代表一个集群, 集群中有多个节点, 其中一个为主节点, 该节点可以通过选举产生.(主从节点只针对于集群内部) 去中心化: 对于集群外来说无中心节点 ...

  5. Java中的static关键字和new关键字作用介绍

    一.static关键字的作用 1.可以用于修改类的成员变量.代码块和类 通过static可以将类的成员声明为静态成员,静态的成员归属于整个类,而不是属于某个对象.无论通过类还是对象访问静态成员,操作的 ...

  6. 一、VIP课程:互联网工程专题 04-Maven私服使用与插件开发

    第四课:Maven私服构建与插件开发.docx 一.maven 生命周期 知识点概要: 生命周期的概念与意义 maven 三大生命周期与其对应的phase(阶段) 生命周期与插件的关系 生命周期与默认 ...

  7. 【LeetCode】 240. 搜索二维矩阵 II

    题目 编写一个高效的算法来搜索 m x n 矩阵 matrix 中的一个目标值 target.该矩阵具有以下特性: 每行的元素从左到右升序排列. 每列的元素从上到下升序排列. 示例: 现有矩阵 mat ...

  8. C语言-逃逸字符、类型转换和布尔类型

    C语言-逃逸字符 逃逸字符是用来表达无法印出来的控制字符或者特殊字符,它由一个反斜杠""开头,后面跟上另一个字符,这两个字符合起来,组成一个字符. \b是backspace,在su ...

  9. nginx报错

    1. nginx报错 nginx: [error] invalid PID number "" in "/usr/local/nginx/logs/nginx.pid&q ...

  10. Spring Boot without the web server

    https://stackoverflow.com/questions/26105061/spring-boot-without-the-web-server/28565277 1. spring.m ...