!!!!再次之前需要保证tomcat下的文件和eclipse下的文件有rwx权限!!!!
点击Server不可添加Tomcat服务器。ServerName无法编辑。
- 关闭Eclipse
- 打开WorkSpace所在的位置。
{workspace-directory}/.metadata/.plugins/org.eclipse.core.runtime/.settings
- 删除以下文件
org.eclipse.wst.server.core.prefs
org.eclipse.jst.server.tomcat.core.prefs
- 重启 Eclipse,即可解决所有问题。
– Close Eclipse
– Go to your Eclipse workspace directory
– Then go to directory .metadata/.plugins/org.eclipse.core.runtime/.settings
– In Ubuntu, I do it by: cd ~/workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings
– Delete the following two files:
– org.eclipse.wst.server.core.prefs
– org.eclipse.jst.server.tomcat.core.prefs
– You can do it by the following command:
rm org.eclipse.wst.server.core.prefs
rm org.eclipse.jst.server.tomcat.core.prefs
– Start Eclipse
If the above solution did not solve the problem then you can try the following solution which contains creating some softlinks along with deleting the above mentioned files.
– Run the following commands in terminal
cd ~/workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/
rm org.eclipse.jst.server.tomcat.core.prefs
rm org.eclipse.wst.server.core.prefs
cd /usr/share/tomcat7
sudo service tomcat7 stop
sudo update-rc.d tomcat7 disable
sudo ln -s /var/lib/tomcat7/conf conf
sudo ln -s /etc/tomcat7/policy.d/03catalina.policy conf/catalina.policy
sudo ln -s /var/log/tomcat7 log
sudo chmod -R 777 /usr/share/tomcat7/conf
sudo ln -s /var/lib/tomcat7/common common
sudo ln -s /var/lib/tomcat7/server server
sudo ln -s /var/lib/tomcat7/shared shared
– Restart eclipse
– In Project Explorer of Eclipse, you can see ‘Servers’. Right click and delete it.
– Re-add the Server (File -> New -> Other -> Server)
– Now your project on Eclipse should run fine.
Suggesting one more way, in the org.eclipse.jst.server.tomcat.core.prefs file as mentioned above rightly, we have an issue. Just open it with any text editor and put the location of your server into inverted commas. e.g. : locationorg.eclipse.jst.server.tomcat.runtime.70=”D:/Apache/Tomcat 7″.
After that restart eclipse and delete server. Create a new server. It should run. Worked for me. (Note : the spaces in folder name are the main issue.)