美文网首页工作小记
eclipse如何配置tomcat(包含没有Server解决办法

eclipse如何配置tomcat(包含没有Server解决办法

作者: 叫子非鱼啊 | 来源:发表于2020-03-27 21:52 被阅读0次
1. 如果你的eclipse中没有server选项,这篇文章或许可以帮助你。
没有server选项,无法配置tomcat

如上图所示,在开发WEB项目配置tomcat时,发现没有server服务选项时,点击help,选择install new software安装tomcat插件。


install new software

在work with中输入

kepler - http://download.eclipse.org/releases/kepler

等到搜索完成,勾选Web,XML, Java EE and OSGi Enterprise Development
点击next完成,等待漫长的安装即可

image.png
完成
image.png
2. 关于apache的安装请看这篇文章Apache Tomcat下载、安装图文教程
3. tomcat的配置

单击Window菜单,选择下方的Preferences

image.png
找到Server下的Runtime Environments
image.png
在Apache文件夹下选择安装的tomcat版本
image.png
选择tomcat安装路径,选择jre的版本-->Finish
image.png
如何让server显示在eclipse中,便于控制
image.png
在show view界面输入servers点击open
image.png
点击链接创建一个server
image.png
一般情况下这里默认就好,如果如要添加的WEB项目就点Next添加项目,暂时没有的话就点击Finish。
image.png
完成后如下图
image.png
这是后点击运行server
  • 如果报这样的一个错误
    The server cannot be started because one or more of the ports are invalid. Open the server editor and correct the invalid ports.
    image.png
    你需要双击你的tomcat server
    image.png
  • 如果出现这样的错误
    Several ports (8005, 8080) required by Tomcat v7.0 Server at localhost are already in use. The server may already be running in another process, or a system process may be using the port. To start this server you will need to stop the other process or change the port number(s).
    image.png
    有可能是你的tomcat已经在运行中了,停掉正在运行的tomcat在这里运行就好了。
    启动成功
    image.png

到这里为止Tomcat在eclipse中配置已经基本完成,可以新建一个WEB项目,将项目添加到server中,开始在html中编写一句Hello World了。

相关文章

网友评论

    本文标题:eclipse如何配置tomcat(包含没有Server解决办法

    本文链接:https://www.haomeiwen.com/subject/hfvruhtx.html