Setup:
Problem:
When I try to add a new Tomcat
This is a known issue.To resolve this error, try one or all of the following:
Window–>Preferences–>Server–>Runtime Environments
and fix the broken path/link for the server.org.eclipse.jst.server.tomcat.core.prefs
to org.eclipse.jst.server.tomcat.core.prefs.bak
(or you can delete this file). This file can be found at \workspace\.metadata\.plugins\org.eclipse.core.runtime\.settings
org.eclipse.wst.server.core.prefs
to org.eclipse.wst.server.core.prefs.bak
(or delete the file). This file also can be found at the same location as above.After trying aleroot's solution without success, VonC's comment on the question was what fixed it for me. So follow the solution suggested here if you hit a wall. Remember to remove the old Tomcat configuration from Runtime Environments afterwards.
A different resolution of the same problem that worked for me. I share it here it might be helpful for someone.
I have - Eclipse Juno - Tomcat 7 - Windows 7
This is what I did
Eclipse > Window > Preferences > Installed JREs and I've got jre7 added and selected here. So I added jre6 by pressing Add button(If not installed or you ran a java update, just download and install jre6). And select jre6 instead of jre7.
Now go to Eclipse > Window > Preferences > Server > Runtime Environment > Press Add and add Tomcat 7.
You're done now.
I had two tomcat 7 runtime configurations added to my Server's Runtime configurations tab. Deleted the duplicate one and fixed the path to the only tomcat 7 which was installed in my system under C:\Program Files\Apache Software Foundation\Tomcat 7.0
and this solved my problem of adding a new server in the servers tab.
Window
> Preferences
> Server
> Runtime Environments
and update the server runtime environment path to change the broken path for the server by clicking Edit
.If you have installed Tomcat 7 with apt-get in a Debian/Ubuntu system, the cleanest solution to this problem is to assign the user under which Eclipse is running to the tomcat7 group.
If for example that user's username is pippo
then you just need to run:
sudo adduser pippo tomcat7
Note: you need to log out and log back in for the changes to take effect.
After trying all the working steps mentioned in the others answers, and even if did not work then,
Change eclipse, workspace and tomcat directory. [tested only for Windows7]
I know somebody might say that is not correct, but above step did work for me.
It took me 4 hours to find this brute force method solution.