I created a new Tomcat Apache Server v7.0 in Eclipse. I have a Java project which I need to run and host on this server in Eclipse. How do I run this project on the new server with the address stat.cmc.edu
Asked
Active
Viewed 3,455 times
3
-
I think we need some clarification here. "Recently we've had to re-start the server and create a new one." What does _a new one_ refer to? And what do you mean with "..create a new server" ? Do you mean start the tomcat process? Or do you mean deploy a war file / inject a project from Eclipse? – mattias Nov 08 '14 at 21:58
-
Sorry for the confusion. In eclipse, we had to delete the older server and create a new Tomcat v7.0 server running through eclipse. What I need to do is take the newly created server, and run my Java project on it, through eclipse. – DeeWBee Nov 08 '14 at 21:59
-
Do you have the possibility to create a .war file of the project? If so, you can have a stand-alone Tomcat server running (I leave this as a comment, as this is not what you ask for, but in my head a way better long-term solution). In short, instead of creating a jar file, or whatever you have, you change the goal to be a war file. – mattias Nov 08 '14 at 22:01
-
@mattias we actually had that set up before but we've run into a lot of development issues recently, so we've kept it on eclipse for quick editing and fixing of the code as we work. – DeeWBee Nov 08 '14 at 22:02
-
Yeah I guess during development, _hot code inject_-kind of development is nice. But really, if this is something you have running for a long time, reconsider :) – mattias Nov 08 '14 at 22:04
-
[This thread](http://stackoverflow.com/questions/998737/integrating-tomcat-and-eclipse-as-a-hot-deploy-environment) seem to be doing somewhat what you ask for, but it's kind of hard to know your setup over there, how you did to run it. – mattias Nov 08 '14 at 22:05
1 Answers
4
Ok, this link gives a quite detailed explanation on how to start the Tomcat Server from within Eclipse and deploy your project onto it. Basically, it consists of these steps:
- Start Eclipse, go to Help -> Install new software -> Choose The Eclipse Web Tools Platform -> Pick the latest SDK
- Make sure your project is a Dynamic Web Project and configure its target runtime to be the Apache Tomcat
- Configure the Tomcat Server, from within Eclipse/Your project
- Run your project as "Run on Server"

mattias
- 2,079
- 3
- 20
- 27
-
1I still vote for configuring projects as .war file goal (with for example Maven as build tool) and deploy on a standalone Tomcat instance. – mattias Nov 08 '14 at 23:07
-
-
1If you create a new project, it is under `File->New->Project..->Web->Dynamic web project` – mattias Nov 08 '14 at 23:13