Step 1: Open up the External Tools Configurations in Eclipse. In Eclipse's toolbar click on the little icon with a run symbol and the toolbox, then External Tools Configurations... .

Step 2: In the dialog box that pops up, right-click on Program and select "New".

Step 3: Give the new run configuration a name such as "Stop Tomcat", and in the "Location" text field enter "/Library/Tomcat/bin/shutdown.sh". You need to adjust the path of the shutdown.sh to match the file's location on your computer. Also, if you're using a Windows machine you need to call shutdown.bin instead. Click "Run".

Step 4: Create another configuration for starting Tomcat be repeating steps 1 through 3.
From now on, starting and stopping Tomcat as well as building your projects is accessible with a click of the mouse. Just click the little down-arrow next to that icon with a run symbol and the toolbox, and you'll see a list of the run configurations that you have set up.

Piece of Cake!!
3 comments:
It says CATALINE_HOME isn't defined correctly. Where do I define that from inside eclipse?
My guess is that somewhere in shutdown.sh or startup.sh, there is a variable called CATALINE_HOME that isn't defined correctly. That isn't a problem related to running that script in Eclipse. Good luck!
I had this problem and solved it by setting the working directory in the run configuration.
Post a Comment