Mr.Queries
Mr.Queries

Reputation: 361

How to run tomcat within eclipse Java Project

*Not Eclipse Dynamic web project, but Eclipse Java project *

I am building my first website and I am using Java. I can connect to tomcat with my browser and I opened the main web page in the browser using tomcat (after deploying), but I wish to connect directly to tomcat inside Eclipse. (I have now just one servlet and one jsp file).

Thanks in advance.

Upvotes: 6

Views: 54500

Answers (5)

Nebi M Aydin
Nebi M Aydin

Reputation: 278

I see what you mean, but there is no particular difference for you to choose between Dynamic Web Project and Java Project.

Simply select Dynamic Web Project, and call your standard java classes from servlet pages.

That way you will get free debug tools built-in for Java Servlet from Eclipse plus.

Upvotes: 0

samimvp
samimvp

Reputation: 141

click on this Installing Apache Tomcat Server

after doing what is in the link, then make new dynamic project in the eclipse then add new jsp and new servlet ,then right click on the your jsp then "Run As" then "Run on Server" then click on the installed application server.

Upvotes: 2

cheersjosh
cheersjosh

Reputation: 1209

Try the following:

  1. Window > Preferences > Server > Runtime Environments > Add
  2. Select the version of Apache Tomcat that you have available
  3. Browse to the Apache Tomcat installation directory
  4. Click Finish

You should have access to the Apache Tomcat server now

Upvotes: 1

Hardik Mishra
Hardik Mishra

Reputation: 14887

You can use Add Server from Servers tab to define a new server.

enter image description here

I am not sure why do you want it without Dynamic Web Project

Upvotes: 2

mthmulders
mthmulders

Reputation: 9705

Convert your project to a "Dynamic Web Project", right-click it and pick "Run As" -> "Run on Server". In the dialog that pops up, select "Manually define a new server" and follow the steps to configure your Tomcat server inside Eclipse.

Upvotes: 0

Related Questions