I\'ve been working on a dynamic web project in Eclipse. I have recently reInstalled my OS and I use a clean eclipse. I can import my web project, but when I try to lunch (run on
On the dialog before you get the "The selection cannot be run on any server" alert, in the upper right side it tells you why you can't add it to the selected server. For me, it was because my Tomcat 8.0 server couldn't run JRE 1.8 projects.
I solved it by creating a new Tomcat 8.0 server, changing the runtime environment from Tomcat 8.0 to my 1.8 jre. Then I could run my project on the new server.
I know this is too late but it will help a googler who accidentally stumbled here while chasing the rabbit hole. Make sure java version stated in the project facet is compatible with your tomcat. Project facet->java (you can right click and change the version)
OK. My experience is not exactly the same as the poster, but rather than ask a similar question and answer it myself, I'll add my two pennyworth here.
When I have tried to import a dynamic web project from work onto my home machine — both Eclipse projects — using
Import -> Existing Projects into Workspace
I have always ended up with a red exclamation mark against my imported project. Googling indicates that this means the project contains build path errors. Following the advice in the ticked answer above I
"Right click the project -> Build path -> Configure build path".
There I find that the JRE System Library has a red cross against it. What to do? This worked:
Delete the JRE System library entry using the Remove button.
Click the Add Library button and select JRE System library. I accepted the default Workspace default JRE.
So I don't have the reconstruction fag any more. (I assume there must be differences between the installations on the two machines, although both are running the same version of Mac OS.)
If you import an exported dynamic web project
, eclipse will import it as a java project
. You have to change the project type manually. For example like this: convert java project to dynamic web project
If I understand you correctly you have imported a previously working web project into a clean install of Eclipse (and OS) and you are tying to run the project on Tomcat. There could be a number of reasons why it isn't working, here are some things to consider in troubleshooting: