Coder Social home page Coder Social logo

Comments (1)

overnightover avatar overnightover commented on July 17, 2024

应该是jdk环境变量没配置吧,JAVA_HOME写死到启动脚本里当然也是可以的

[root@localhost init.d]# cat tomcat 
#!/bin/bash
#chkconfig:- 20 90
#description:tomcat
#processname:tomcat
TOMCAT_HOME=/usr/local/tomcat/apache-tomcat-8.5.55
case $1 in
	start) su root $TOMCAT_HOME/bin/startup.sh;;
	stop) su root $TOMCAT_HOME/bin/shutdown.sh;;
	*) echo "require start|stop" ;;
esac
[root@localhost init.d]# 

[root@localhost init.d]# java -version
java version "1.8.0_161"
Java(TM) SE Runtime Environment (build 1.8.0_161-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.161-b12, mixed mode)
[root@localhost init.d]# 

[root@localhost init.d]# service tomcat shutdown
require start|stop
[root@localhost init.d]# service tomcat start
Using CATALINA_BASE:   /usr/local/tomcat/apache-tomcat-8.5.55
Using CATALINA_HOME:   /usr/local/tomcat/apache-tomcat-8.5.55
Using CATALINA_TMPDIR: /usr/local/tomcat/apache-tomcat-8.5.55/temp
Using JRE_HOME:        /usr/local/java/jdk1.8.0_161
Using CLASSPATH:       /usr/local/tomcat/apache-tomcat-8.5.55/bin/bootstrap.jar:/usr/local/tomcat/apache-tomcat-8.5.55/bin/tomcat-juli.jar
Tomcat started.
[root@localhost init.d]# 

from javacollection.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.