Aleksei Nikolaevich
Aleksei Nikolaevich

Reputation: 325

How to start apache tomcat packaged within eclipse?

My company does not allow me to upload apache tomcat from the official website . They told me that I already have it as a "plug in " in Eclipse . It's sort of packaged . So , anyway I could not find a startup.bat file anywhere .

I have the following folder on my computer that presumably contains apache tomcat somehow installed there. I am not sure whether i have a jboss . Here is the folder

enter image description here

If I go to the jre folder there is a servertool.exe . It looks like this

enter image description here

I am not sure how I can start apache tomcat . I mean I am not allowed to upload the zip file directly form the website, otherwise I could have used the startup.bat . . . I have never encountered a situation like this . I do not have a regular apache tomcat folder .

I tried localhost:8080 no result How can I start working with it ? Thanks

Upvotes: 1

Views: 222

Answers (1)

Steve Schneider
Steve Schneider

Reputation: 402

Eclipse does not ship with Tomcat. It integrates very nicely with it, though, after you install Tomcat. These instructions are for Eclipse Kepler SR1; other Eclipse versions are similar. There are third-party plugins that do this too, but the native plugin works nicely. Also, I'm not sure, but pretty sure, that you need the "Java EE IDE" version of Eclipse, not just regular Eclipse for Java. The steps:

1) Install Tomcat from the ZIP file (which just means extracting the ZIP to somewhere like c:\tomcat)

2) In Eclipse, choose Preferences from the Window menu; in the search box, type "runtime", then click Runtime Environments under the Server category (if you don't see this, you may not be running Eclipse Java EE; again, not sure if "regular" Eclipse for Java is enough).

3) Click the "Add" button and go through the process of telling Eclipse about where your Tomcat server is (i.e., it's where you just installed it to).

4) Create a Dynamic Web Project for your web-app (regular Java projects won't work; if your code is already in a regular project, migrate it into a Dynamic Web Project).

5) From the Window menu, choose Show View, then Other, then type "servers" and double-click Servers.

6) In The Servers pane, right-click anywhere in the pane and choose New, then Server. Follow the instructions to create a new Server that uses the Tomcat runtime you just created in Eclipse. When you're done, you'll have a Tomcat server listed in the Servers pane.

7) Not it's time to add your Dynamic Web Project to the list of web-apps that this server (that is, this Tomcat) knows about. So, right-click on your Tomcat server in the Servers pane, and choose Add and Remove. In the dialog that opens up, click Add All, then Finish.

8) Start Tomcat by clicking the Debug icon above the Servers pane (it looks like a green bug). Load http://localhost:8080/ (or http://localhost:8080/yourappname depending on your config) and you're done. (You can also run Tomcat by clicking the Run icon -- instead of Debug -- but one of the big reasons to run Tomcat from within Eclipse is that you get to use Eclipse's debugging functionality.)

Upvotes: 2

Related Questions