Cannot add a project to a Tomcat server in Eclipse
JavaEclipseTomcatJstJava Problem Overview
I cannot add my project to a server in Eclipse - why is that?
I installed all necessary tools (Web Dev, Java EE, Server Adapters, and Tomcat itself, everything)
I configured the runtime environments, adjusted all Java Versions to JDK 6 (because it should run on Tomcat 6), but still the left side of the dialogue where I could add resources is empty when creating a new server.
What else could I try?
PS: I am using Eclipse v4.2 (Juno) on Windows 7 Professional.
Java Solutions
Solution 1 - Java
You didn't create your project as "Dynamic Web Project", so Eclipse doesn't recognize it like a web project. Create a new "Dynamic Web Project" or go to Properties → Projects Facets and check Dynamic Web Module.
Solution 2 - Java
- Right click on the project name in the Package Explorer view.
- Select Properties
- Select Project Facets
- Click on the Runtimes tab
- Check Server
- Click on OK
And now:
- Right click on the server name in the Servers view
- Click on Add and Remove...
- Move resources to the right column
Solution 3 - Java
If you are able to see the project in Eclipse project explorer but unable to see the project while adding the project to the web server, follow project properties -> Project Facets, make sure Dynamic Web Module & Java were ticked.
Solution 4 - Java
I fixed this issue as adding Dynamic Web Module to Project Facets
- right click on project name in the Package Explorer view.
- select Properties
- Select Project Facets
- Activate Dynamic Web Module
- Click on OK
Solution 5 - Java
- Right-click on project
- Go to properties => project factes
- Click on runtime tab
- Check the box of the server
- Then ok
Close the eclipse and start the server you will able to see and run the project.
Solution 6 - Java
Go to project properties -> Project Facets. Make sure the Dynamic Web Module and Java is checked.
Apart from it, "Cloud Foundry Standalone Application" needs to be un-checked, if it is already selected. By default, few IDEs preselect this option.
Solution 7 - Java
After following the steps suggested by previous posters, do the following steps:
- Right click on the project
- Click Maven, then Update Project
- Tick the checkbox "Force Update of Snapshots/Releases", then click OK
You should be good to go now.
Solution 8 - Java
In my case:
Project properties → Project Facets. Make sure "Dynamic Web Module" is checked. Finally, I enter the version number "2.3" instead of "3.0". After that, the Apache Tomcat 5.5 runtime is listed in the "Runtimes" tab.
Solution 9 - Java
Steps I used to resolve it:
- Double click on Tomcat Server in the Servers tab.
- In a dropdown next to Runtime Environment:, select Apache Tomcat
your version
- Click on save.
Now, you should be able to add to server on right click "Add and Remove".
Note: Additionally, when on clear/run, you get an error for multiple instances, open server.xml and ensure that it contains a single instance of each application and not multiple.
Solution 10 - Java
In my case, the .project file was read-only (it was pulled from the source code control system that way). Making it writable resolved the issue.
Eclipse v4.7 (Oxygen).
Solution 11 - Java
For me:
It was Eclipse v4.5 (Mars) which did not support Java SE 7, so I added Java SE 8. It worked.