使用sh startup.sh启动tomcat报错

今天尝试自动更新服务器上tomcat中的web安装包

启动python脚本的时候,发现报错:

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

大致我理解就是:需要配置jdk和jre的环境变量才能运行该程序

于是检查服务器上环境变量,好像没啥问题呀:

然后查看startup.sh文件:发现startup.sh会调用到catalina.sh文件

接着去查看catalina.sh文件:发现catalina.sh会调用setclasspath.sh文件:

因此需要在setclasspath.sh中手动声明一下环境变量

偷懒点去vi /etc/profile中找到自己的环境变量粘贴过来哈哈

export JAVA_HOME=/usr/java/jdk1.8.0_161

export JRE_HOME=/usr/java/jdk1.8.0_161/jre

( windows版本,对应bat文件,export改为set )

想要了解tomcat运行脚本和启动过程的,参见大佬:https://blog.csdn.net/qq_21508059/article/details/82713797

原文地址:https://www.cnblogs.com/Ternura-1023/p/11611915.html

时间: 2024-08-28 09:40:17

使用sh startup.sh启动tomcat报错的相关文章

tomcat单独启动成功, eclipse启动tomcat报错, 错误一:找不到或无法加载主类 org.apache.catalina.startup.Bootstrap;错误二:端口被占用

针对刚遇到的tomcat单独启动成功,但是在eclipse启动tomcat就报错问题作出总结如下: 软件版本: 1. eclipse版本 ① Luna Service Release 2(4.4.2)    64位 ② Helios Service Release 2   64位 2. tomcat版本 ①apache-tomcat-6.0.14 ②apache-tomcat-6.0.35 3. JDK版本 jdk1.6.0_45 64位 错误详情: 1.  tomcat启动失败,错误提示: j

linux下启动tomcat报错 Failed to get local InetAddress for VMID. This is unlikely to matter. At all. We'll add some extra randomness

INFO [localhost-startStop-1] com.mchange.v2.log.slf4j.Slf4jMLog$Slf4jMLogger$InfoLogger.log(206) | Failed to get local InetAddress for VMID. This is unlikely to matter. At all. We'll add some extra randomnessjava.net.UnknownHostException: Oracle.Linu

【转】Eclipse下启动tomcat报错:/bin/bootstrap.jar which is referenced by the classpath, does not exist.

转载地址:http://blog.csdn.net/jnqqls/article/details/8946964 1.错误: 在Eclipse下启动tomcat的时候,报错为:Eclipse下启动tomcat报错:The archive: C:/Program Files(x86)/Java/jdk1.7.0_10/lib/tools.jar which is referenced by the classpath, doesnot exist. 2.原因: 这是因为我中途移动过tomcat的位

Eclipse3.6+Blazeds+Flex4.6启动tomcat报错

在eclipse中启动tomcat时出现Setting property 'source' to 'org.eclipse.jst.jee.server:你的站点名'   did not find a matching property错误 解决办法: 1.在server控制台内,在服务器上点右键--属性 2.general选项卡中点switch location 这时,location变为:/servers/tomcat6.0 server at localhost.server 3.在pro

IDEA启动Tomcat报错

Maven编译成功, 可是启动Tomcat报错: Application Server was not connected before run configuration stop, reason: java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.CommunicationException [Root exception is java.rmi.ConnectIOException: error dur

Address localhost:1099 is already in use(IDEA启动Tomcat报错1099 is already in use)

IDEA中启动Tomcat报错,Error running Tomcat7.0.52: Address localhost:1099 is already in use 或者是 java.rmi.server.ExportException: Port already in use: 1099 ,表示1099端口被其他进程占用了. 解决方法: 1. win+R,运行,输入cmd,进入命令提示符 2. 输入netstat -aon | findstr 1099,找到占用1099端口的进程ID:PI

eclipse中以debug方式启动tomcat报错

在eclipse中debug  Tomcat报错,错误如下: FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197) ERROR: transport error 202: connect failed: Operation timed out ERROR: JDWP Transport dt_socket failed to initiali

启动TOMCAT报错 java.util.zip.ZipException: invalid LOC header (bad signature)

报错信息大致如下所示: at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:303) at org.apache.catalina.startup.Bootstrap.main(Bootstr

Eclipse中启动Tomcat报错(struts2应用开发)

今天开始接触struts2,完成应用后一大堆报错,其实通过[项目]->[右键]->[build path]->[configure build path]改相应的配置就能够改正所有错误了.很多错误可以通过网上搜素改正.通过纠正这些错误也有助于你更好的理解开发strut2的一些配置. 解决了所有错误后,启动tomcat服务器网页总是报错.这时候可以去看看Console的一些信息,会发现以下错误: 严重: Exception starting filter struts2 java.lang