简体   繁体   中英

Make it easy to start tomcat instances on Mac

I have two tomcat servers installed, at the locations:

/Users/alexstaveley/developer/servers/apache-tomcat-6.0.37
/Users/alexstaveley/developer/servers/apache-tomcat-7.0.42

To start them, I am opening a terminal CDing the right bin directory and then doing

sh catalina.sh start

This is getting cumbersome. I'd much prefer to have something on my doc or desktop and then just click the instance I want to start.

Any tips?

If you rename the *.sh files to *.command , you can just doubleclick them (I don't have a Mac to double-check, you might need to chmod +x them).

If you want the shell to open, just create a file startTomcat.command with sh catalina.sh start as its sole content

  • After installing tomcat rename the folder to tomcat and place that tomcat folder under Macintosh HD -> Users -> alexstaveley directory

  • Change the tomcat->bin->startup.sh file, open startup.sh in textedit, add the following 2 lines after EXECUTABLE=catalina.sh line

    export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.5/Home export CATALINA_HOME=/Users/user/Tomcat**
  • Finally to start tomcat, open Mac Terminal

     cd /Users/alexstaveley/tomcat/bin sh startup.sh

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM