Error:
Cannot find ./catalina.sh
The file is absent or does not have execute permission
This file is needed to run this program
Cause.
No executable permissions were granted to the files in the bin directory.
Solution:
chmod +x bin/*.sh
The error Neither the JAVA_HOME nor the JRE_HOME environment variable is defined.
The solution is as follows.
tomcat startup script file: startup.sh, startup.sh will load catalina.sh , catalina.sh will load setclasspath.sh
Linux: export JAVA_HOME=absolute path Windows: set
You can add directly to the second line.
#!/bin/sh
export JAVA_HOME=/usr/local/java1.8
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the “License”); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
success
[root@hadoop1 apache-tomcat-8.0.43]# sudo bin/startup.sh
/home/report/apache-tomcat-8.0.43/bin/catalina.sh:行143: -Xmx1024m: 未找到命令
Using CATALINA_BASE: /home/report/apache-tomcat-8.0.43
Using CATALINA_HOME: /home/report/apache-tomcat-8.0.43
Using CATALINA_TMPDIR: /home/report/apache-tomcat-8.0.43/temp
Using JRE_HOME: /home/jdk-10.0.1
Using CLASSPATH: /home/report/apache-tomcat-8.0.43/bin/bootstrap.jar:/home/report/apache-tomcat-8.0.43/bin/tomcat-juli.jar
Tomcat started.
The above was added to the catalina.sh file. There is still the problem that the shutdown command runs with an error shutdown.sh
[root@hadoop1 apache-tomcat-8.0.43]# sudo bin/shutdown.sh
/home/report/apache-tomcat-8.0.43/bin/catalina.sh: line 143: -Xmx1024m: Cannot find commands
Using CATALINA_BASE: /home/report/apache-tomcat-8.0.43
Using CATALINA_HOME: /home/report/apache-tomcat-8.0.43
Using CATALINA_TMPDIR: /home/report/apache-tomcat-8.0.43/temp
Using JRE_HOME: /home/jdk-10.0.1
Using CLASSPATH: /home/report/apache-tomcat-8.0.43/bin/bootstrap.jar:/home/report/apache-tomcat-8.0.43/bin/tomcat-juli.jar./catalina.sh: 1: eval: usrjjdk-10.0.1re/bin/java: not found
It still says not found, and the path usrjdk-10.0.1jre is somehow missing the ‘/’.
Workaround.
rewrite the export JAVA_HOME environment variable you just modified to setclasspath.sh and remove the catalina.sh export one
Successfully solved:
[root@hadoop1 apache-tomcat-8.0.43]# sudo bin/shutdown.sh
/home/report/apache-tomcat-8.0.43/bin/catalina.sh:行143: -Xmx1024m: 未找到命令
Using CATALINA_BASE: /home/report/apache-tomcat-8.0.43
Using CATALINA_HOME: /home/report/apache-tomcat-8.0.43
Using CATALINA_TMPDIR: /home/report/apache-tomcat-8.0.43/temp
Using JRE_HOME: /home/jdk-10.0.1
Using CLASSPATH: /home/report/apache-tomcat-8.0.43/bin/bootstrap.jar:/home/report/apache-tomcat-8.0.43/bin/tomcat-juli.jar
Similar Posts:
- The CATALINA_HOME environment variable is not defined correctly
- Tomcat Command Error: Catalina.stop: connect reused solution
- Linux Install Tomcat Error: service tomcat does not support chkconfig
- Ubuntu Tomcat Server:insserv: warning: script ‘tomcat’ missing LSB tags and overrides
- How to Solve The Process Still Exsit after Tomcat Shutdown
- Tomcat7 starts with error listener start
- java.lang.UnsupportedClassVersionError:Unsupported major.minor version 52.0
- [Solved] org.apache.catalina.startup.HostConfig.deployWAR Error deploying web application archive
- Tomcat Cannot assign requested address: JVM_Bind [How to Solve]
- [Solved] Tomcat Error: SEVERE: Error listenerStart