Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run on server option not appearing in Eclipse

Tags:

java

eclipse

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.

like image 232
swingfuture Avatar asked Nov 12 '10 16:11

swingfuture


People also ask

Where is Server option in Eclipse?

In the Java EE perspective of Eclipse, you will find the Servers tab at the bottom.

How do I enable Server view in Eclipse?

If you goto "Window > Show View > Other..." and then type Servers in the filter, does it show up? Also make sure you downloaded the "Eclipse For Java EE Developers" package as I do not believe the "Eclipse for Java Developers" contains the Servers view. Show activity on this post. Restart Eclipse.

How do I run an Eclipse Server?

Go to the project in the Project Explorer, select the web project, right click and select "Run As", you will see Apache Tomcat, create runtime configuration for the web project by selecting "New" button.

Why can't I run a Java file in Eclipse?

First make sure that you made a regular "Java Project", and not something else. If there's something wrong with the build configuration, which i guess there is, go to: Run > Run Configurations... On the left you will see a list of configurations, make sure your configuration runs as a "Java Application".


2 Answers

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

like image 94
Jared Avatar answered Sep 17 '22 02:09

Jared


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,

like image 42
hoonzis Avatar answered Sep 18 '22 02:09

hoonzis