解决在eclipse中配置Tomcat时,出现"Cannot create a server using the selected type"的错误

时间:2022-07-13 07:49:33

比如说使用tomcat

这是因为你之前创建过一次,比如说tomcat6,你指定的目录是:D:/tomcat-6.0.3

后来因为某种原因你把tomcat删了,然后你又安装到了E:/tomcat-6.0.3

这样你在使用eclipse创建tomcat6的时候,eclipse还是以“D:/tomcat-6.0.3”去查找tomcat,但是查不到。所以就报错了。有两大症状:

1、提示“Cannot create a server using the selected type”

2、Server name这个text field变为灰色的,无法编辑

-----------------------------------------------------------

解决办法:在eclipse中,选择

Window>Preferences>Server>Runtime Environment

你会看到你以前配置的tomcat6的参数,edit之,改为新的目录,即“E:/tomcat-6.0.3”

或者直接delete>OK,然后重新创建即可