Run on server option not appearing in Eclipse

JavaEclipse

Java Problem Overview


I'm learning SpringMVC framework and checked out a copy of their code: https://src.springframework.org/svn/spring-samples/mvc-basic/trunk/ I can do maven build, install and everything. But on Eclipse, run on server option never appeared. I have tomcat server up and running, also got plugin for eclipse. Why run on server option is missing? This is a Ubuntu machine. When I tried the exact same thing on my Windows machine, everything was fine. It has the same version of eclipse and all sorts of plugins installed as the Ubuntu machine. I was able to launch it from Eclipse "run on server" option there.

Can someone help me to figure out why? Thanks.

Java Solutions


Solution 1 - Java

Did you create a Web Project? If you right click on the project and go to Properties > Project Facets is Dynamic Web Module selected?

Solution 2 - Java

I had a similar issue. The Maven projects have different structure than "Dynamic Web Projects". Eclipse knows only how to deploy the Dynamic Web Projects (project structure used by Web Tools Platform).

In order to solve this and tell Eclipse how to deploy a "maven style" projects, you have to install the M2E Eclipse WTP plugin (I suppose you are already using the m2e plugin).

To install: Preferences->Maven->Discovery->Open Catalog and choose the WTP plugin.

After reinstalling, you will be able to "run on server" those projects which are maven web projects.

Hope that helps,

Solution 3 - Java

The topic is old but today I was facing the same problem, I imported a Maven project and when I tried adding to Tomcat it did not show the project. What worked for me:
Properties >> Project Facets and then check the options:
Dynamic Web Module + Java then click in apply. I hope it helps :)

Solution 4 - Java

For me worked: Right click on project > Properties > Project Faces > change Configuration from "custom" to "Default configuration for Apache Tomcat v7.0" > OK and then Run on Server option has appeared.

Solution 5 - Java

Follow the below steps:

  1. Right click on your maven project.

  2. Select Maven

  3. Update Project

  4. check the

  • update project configuration from pom.xml

  • refresh workspace resources from local filesystem.

  • clean projects.

That's it.

Solution 6 - Java

Do you see any servers in server view in eclipse? Probably simply you have not created any server instances.

Solution 7 - Java

Perhaps you lost some configuration, check jar dependencies in properties -> Deployment Assembly. If you miss something, try to add dependencies again.

in my case, fixing this, Run on Server appear again.

Solution 8 - Java

There is only 1 thing that fixed this for me. In the pom.xml, add the tag:

<packaging>war</packaging>

Then after saving that, when you right click on the project you should now see the "Run As... Run on Server" option showing up.

Solution 9 - Java

I had to do the following

  1. remove /WebContent from Deployment Assembly and add /src/main/webapp
  2. Add Library (Properties->Java Build Path->Libraries), Server Runtimes

This got me working, in addition to @alanbartczak answer.

Solution 10 - Java

we have to install the M2E Eclipse WTP plugin To install: Preferences->Maven->Discovery->Open Catalog and choose the WTP plugin.

And restart eclipse

Solution 11 - Java

I was facing similar issue when i created a new workspace in STS. Project => right click => Maven option was also missing. I tried this below steps and it worked.. hope it helps someone else. Project => right click => configure => convert to maven project and then the option to run on server appeared.

Solution 12 - Java

Right click on the project, go to "Run as", select "Run configurations" and create a run configuration.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionswingfutureView Question on Stackoverflow
Solution 1 - JavaJaredView Answer on Stackoverflow
Solution 2 - JavahoonzisView Answer on Stackoverflow
Solution 3 - JavaRodrigo AlmeidaView Answer on Stackoverflow
Solution 4 - JavaalanbartczakView Answer on Stackoverflow
Solution 5 - JavaNishat LakhaniView Answer on Stackoverflow
Solution 6 - JavaGábor LiptákView Answer on Stackoverflow
Solution 7 - JavaDavid CanósView Answer on Stackoverflow
Solution 8 - JavaWoodchuckView Answer on Stackoverflow
Solution 9 - JavaSiddharthView Answer on Stackoverflow
Solution 10 - Java TilluView Answer on Stackoverflow
Solution 11 - JavadevView Answer on Stackoverflow
Solution 12 - JavaRakeshView Answer on Stackoverflow