如何在Eclipse或者Myeclipse中使用tomcat(配置tomcat,发布web项目)?(图文详解)(很实用)

简介:

如何在Myeclipse中使用tomcat(配置tomcat,发布web项目)?

   首先,打开MyEclipse,点击菜单栏中 window–>preference –>Myeclipse –>servers->tomcat(也可以window-preference –>搜索tomcat)
选择你自己需要的tomcat (我的是tomcat 7.x)前提是你已经有自己解压好的tomcat。

  



 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

   然后, 在tomcat 7.x 中配置 你自己的tomcat路径信息 (如我这里是D:\SoftWare\apache-tomcat-7.0.69)

 

   

 

   然后,然后配置相应的tomcat 7.x 下的jdk,点击add, 然后找到自己的jdk的目录,然后点击apply

 

 

   这是我本地的

 

 

 

 

 

   然后,再返回tomcat 7.x 页面 ,选择enable,点击Apply

 

 

 

   最后,选择MYEclipse的 tomcat 4.x ,选择disable,点击OK 即可

 

 

   接着,来

如何发布MyEclipse中的web项目

 

   首先,创建好自己的Web工程后,点击如图下所示图标:

 

 

 

 

 

   然后,在Project下选择要发布的工程名称

 

 

 

 

   然后点击右侧的 add 按钮

 

 

 

 

   在 Server 下选择自己的Tomcat (Tomcat 7.x)

 

 

 

 

 

 

 

 

 

 

 

   然后,点击finish 后,点击OK,下方消息框出现下图,则是发布成功 

 

 

 

 

 

  然后,选中你所创建的web项目->单击右键->选择run as->MyEclipse Server Application->在弹出的对话框中选择任意一个都可以->ok

 

 

 

 

 

 

 

 

   以下分为在本地(如我的win7系统里安装的Tomcat 7.x ),或者大家也可以用MyEclipse自带的MyEclipse Tomcat

 方式一: 本地(如我的win7系统里安装的Tomcat 7.x )

 

 

 

  或者这样来操作,也是可以的

 

 

 

 

 

 

 

 

 

 

 

复制代码
七月 29, 2017 2:44:06 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server version:        Apache Tomcat/7.0.69
七月 29, 2017 2:44:06 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server built:          Apr 11 2016 07:57:09 UTC
七月 29, 2017 2:44:06 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server number:         7.0.69.0
七月 29, 2017 2:44:06 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: OS Name:               Windows 7
七月 29, 2017 2:44:06 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: OS Version:            6.1
七月 29, 2017 2:44:06 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Architecture:          amd64
七月 29, 2017 2:44:06 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Java Home:             C:\Program Files\Java\jdk1.7.0_51\jre
七月 29, 2017 2:44:06 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: JVM Version:           1.7.0_51-b13
七月 29, 2017 2:44:06 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: JVM Vendor:            Oracle Corporation
七月 29, 2017 2:44:06 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: CATALINA_BASE:         D:\SoftWare\apache-tomcat-7.0.69
七月 29, 2017 2:44:06 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: CATALINA_HOME:         D:\SoftWare\apache-tomcat-7.0.69
七月 29, 2017 2:44:06 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dcatalina.home=D:\SoftWare\apache-tomcat-7.0.69
七月 29, 2017 2:44:06 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dcatalina.base=D:\SoftWare\apache-tomcat-7.0.69
七月 29, 2017 2:44:06 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Djava.endorsed.dirs=D:\SoftWare\apache-tomcat-7.0.69/common/endorsed
七月 29, 2017 2:44:06 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Djava.io.tmpdir=D:\SoftWare\apache-tomcat-7.0.69\temp
七月 29, 2017 2:44:06 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Djava.library.path=C:\Program Files\Java\jdk1.7.0_51\bin;D:\SoftWare\apache-tomcat-7.0.69\bin
七月 29, 2017 2:44:06 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dsun.io.useCanonCaches=false
七月 29, 2017 2:44:06 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
信息: Loaded APR based Apache Tomcat Native library 1.1.33 using APR version 1.5.1.
七月 29, 2017 2:44:06 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
信息: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
七月 29, 2017 2:44:07 下午 org.apache.catalina.core.AprLifecycleListener initializeSSL
信息: OpenSSL successfully initialized (OpenSSL 1.0.1m 19 Mar 2015)
七月 29, 2017 2:44:07 下午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["http-apr-8080"]
七月 29, 2017 2:44:07 下午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["ajp-apr-8009"]
七月 29, 2017 2:44:07 下午 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 3317 ms
七月 29, 2017 2:44:08 下午 org.apache.catalina.core.StandardService startInternal
信息: Starting service Catalina
七月 29, 2017 2:44:08 下午 org.apache.catalina.core.StandardEngine startInternal
信息: Starting Servlet Engine: Apache Tomcat/7.0.69
七月 29, 2017 2:44:08 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory D:\SoftWare\apache-tomcat-7.0.69\webapps\docs
七月 29, 2017 2:44:08 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory D:\SoftWare\apache-tomcat-7.0.69\webapps\docs has finished in 139 ms
七月 29, 2017 2:44:08 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory D:\SoftWare\apache-tomcat-7.0.69\webapps\examples
七月 29, 2017 2:44:11 下午 org.apache.catalina.core.ApplicationContext log
信息: ContextListener: contextInitialized()
七月 29, 2017 2:44:11 下午 org.apache.catalina.core.ApplicationContext log
信息: SessionListener: contextInitialized()
七月 29, 2017 2:44:11 下午 org.apache.catalina.core.ApplicationContext log
信息: ContextListener: attributeAdded('org.apache.jasper.compiler.TldLocationsCache', 'org.apache.jasper.compiler.TldLocationsCache@401eea7c')
七月 29, 2017 2:44:11 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory D:\SoftWare\apache-tomcat-7.0.69\webapps\examples has finished in 2,209 ms
七月 29, 2017 2:44:11 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory D:\SoftWare\apache-tomcat-7.0.69\webapps\host-manager
七月 29, 2017 2:44:11 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory D:\SoftWare\apache-tomcat-7.0.69\webapps\host-manager has finished in 321 ms
七月 29, 2017 2:44:11 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory D:\SoftWare\apache-tomcat-7.0.69\webapps\manager
七月 29, 2017 2:44:11 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory D:\SoftWare\apache-tomcat-7.0.69\webapps\manager has finished in 294 ms
七月 29, 2017 2:44:11 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory D:\SoftWare\apache-tomcat-7.0.69\webapps\ROOT
七月 29, 2017 2:44:12 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory D:\SoftWare\apache-tomcat-7.0.69\webapps\ROOT has finished in 431 ms
七月 29, 2017 2:44:12 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory D:\SoftWare\apache-tomcat-7.0.69\webapps\sport-web
七月 29, 2017 2:44:25 下午 org.apache.catalina.startup.TldConfig execute
信息: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
七月 29, 2017 2:44:25 下午 org.apache.catalina.core.ApplicationContext log
信息: No Spring WebApplicationInitializer types detected on classpath
七月 29, 2017 2:44:25 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory D:\SoftWare\apache-tomcat-7.0.69\webapps\sport-web has finished in 13,772 ms
七月 29, 2017 2:44:25 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["http-apr-8080"]
七月 29, 2017 2:44:25 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["ajp-apr-8009"]
七月 29, 2017 2:44:25 下午 org.apache.catalina.startup.Catalina start
信息: Server startup in 18020 ms
复制代码

 

 

   

http://localhost:8080/***

 

   贴图

 

 

 

 

方式二、MyEclipse自带的MyEclipse Tomcat

 

 

 

   贴图

 

 

 

   注意:别忘记,还需在

D:\Code\MyEclipseHadoopCode\***\WebRoot

  ***是项目名

  我的项目编写的代码是在D:\Code\MyEclipseHadoopCode\***\

 

 

 

 

 

 

 

 

 

 

 

如何在Eclipse中使用tomcat(配置tomcat,发布web项目)?

 

   直接

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  来到如下界面,在左边选择你需要的项目,双击,添加到右边,然后完成即可。

 

 

 

 

 

 

 

 

 

 

 

  接着,来

  如何发布Eclipse中的web项目

   直到这里,你的server中就有你的项目了

 

 

 

 

 

   然后,鼠标选中你刚刚添加的server,右键启动

 

 

 

 

 

 

 

 

 

复制代码
七月 29, 2017 3:22:34 下午 org.apache.tomcat.util.digester.SetPropertiesRule begin
警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:PJT' did not find a matching property.
七月 29, 2017 3:22:34 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server version:        Apache Tomcat/7.0.69
七月 29, 2017 3:22:34 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server built:          Apr 11 2016 07:57:09 UTC
七月 29, 2017 3:22:34 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server number:         7.0.69.0
七月 29, 2017 3:22:34 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: OS Name:               Windows 7
七月 29, 2017 3:22:34 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: OS Version:            6.1
七月 29, 2017 3:22:34 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Architecture:          amd64
七月 29, 2017 3:22:34 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Java Home:             C:\Program Files\Java\jdk1.7.0_51\jre
七月 29, 2017 3:22:34 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: JVM Version:           1.7.0_51-b13
七月 29, 2017 3:22:34 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: JVM Vendor:            Oracle Corporation
七月 29, 2017 3:22:34 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: CATALINA_BASE:         D:\Code\eclipseMarsCode\.metadata\.plugins\org.eclipse.wst.server.core\tmp0
七月 29, 2017 3:22:34 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: CATALINA_HOME:         D:\SoftWare\apache-tomcat-7.0.69
七月 29, 2017 3:22:34 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dcatalina.base=D:\Code\eclipseMarsCode\.metadata\.plugins\org.eclipse.wst.server.core\tmp0
七月 29, 2017 3:22:34 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dcatalina.home=D:\SoftWare\apache-tomcat-7.0.69
七月 29, 2017 3:22:34 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dwtp.deploy=D:\Code\eclipseMarsCode\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps
七月 29, 2017 3:22:34 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Djava.endorsed.dirs=D:\SoftWare\apache-tomcat-7.0.69\endorsed
七月 29, 2017 3:22:34 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dfile.encoding=GBK
七月 29, 2017 3:22:34 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
信息: Loaded APR based Apache Tomcat Native library 1.1.33 using APR version 1.5.1.
七月 29, 2017 3:22:34 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
信息: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
七月 29, 2017 3:22:35 下午 org.apache.catalina.core.AprLifecycleListener initializeSSL
信息: OpenSSL successfully initialized (OpenSSL 1.0.1m 19 Mar 2015)
七月 29, 2017 3:22:35 下午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["http-apr-8080"]
七月 29, 2017 3:22:36 下午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["ajp-apr-8009"]
七月 29, 2017 3:22:36 下午 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 3032 ms
七月 29, 2017 3:22:36 下午 org.apache.catalina.core.StandardService startInternal
信息: Starting service Catalina
七月 29, 2017 3:22:36 下午 org.apache.catalina.core.StandardEngine startInternal
信息: Starting Servlet Engine: Apache Tomcat/7.0.69
七月 29, 2017 3:22:51 下午 org.apache.catalina.startup.TldConfig execute
信息: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
七月 29, 2017 3:22:51 下午 org.apache.catalina.core.ApplicationContext log
信息: No Spring WebApplicationInitializer types detected on classpath
七月 29, 2017 3:22:51 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["http-apr-8080"]
七月 29, 2017 3:22:51 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["ajp-apr-8009"]
七月 29, 2017 3:22:51 下午 org.apache.catalina.startup.Catalina start
信息: Server startup in 15439 ms
复制代码

 

 

 

 

   启动成功后再到浏览器中输入:http://localhost:8080/***  。回车,如果不出错的话应该应该就能显示出的默认页面了。

 

本文转自大数据躺过的坑博客园博客,原文链接:http://www.cnblogs.com/zlslch/p/7255550.html,如需转载请自行联系原作者


目录
打赏
0
0
0
0
64
分享
相关文章
框架源码私享笔记(01)Tomcat核心架构功能 | 配置详解
本文首先分享了《活出意义来》一书序言中的感悟,强调成功如同幸福,不是刻意追求就能得到,而是全心投入时的副产品。接着探讨了Tomcat的核心功能与架构解析,包括网络连接器(Connector)和Servlet容器(Container),并介绍了其处理HTTP请求的工作流程。文章还详细解释了Tomcat的server.xml配置文件,涵盖了从顶级容器Server到子组件Connector、Engine、Host、Context等的配置参数及作用,帮助读者理解Tomcat的内部机制和配置方法。
Tomcat如何配置PFX证书?
【10月更文挑战第2天】Tomcat如何配置PFX证书?
366 7
Tomcat如何配置JKS证书?
【10月更文挑战第2天】Tomcat如何配置JKS证书?
605 4
centos7环境下tomcat8的安装与配置
本文介绍了在Linux环境下安装和配置Tomcat 8的详细步骤。首先,通过无网络条件下的文件交互软件(如Xftp 6或MobaXterm)下载并解压Tomcat安装包至指定路径,启动Tomcat服务并测试访问。接着,修改Tomcat端口号以避免冲突,并部署Java Web应用项目至Tomcat服务器。最后,调整Linux防火墙规则,确保外部可以正常访问部署的应用。关键步骤包括关闭或配置防火墙、添加必要的端口规则,确保Tomcat服务稳定运行。
Liunx部署java项目Tomcat、Redis、Mysql教程
本文详细介绍了如何在 Linux 服务器上安装和配置 Tomcat、MySQL 和 Redis,并部署 Java 项目。通过这些步骤,您可以搭建一个高效稳定的 Java 应用运行环境。希望本文能为您在实际操作中提供有价值的参考。
224 26
Mac系统下配置环境变量:Javajdk、maven、tomcat 环境变量配置及对应配置文件
这篇文章介绍了如何在Mac系统下配置Java JDK、Maven和Tomcat的环境变量,包括配置文件的选择、解决环境变量在zsh shell中无效的问题、查看和设置系统环境变量的方法,以及JDK和Maven的下载、配置和测试步骤。
1930 1
Mac系统下配置环境变量:Javajdk、maven、tomcat 环境变量配置及对应配置文件
|
5月前
apache+tomcat配置多站点集群的方法
apache+tomcat配置多站点集群的方法
77 4
idea+maven+tomcat+spring 创建一个jsp项目
这篇文章介绍了如何在IntelliJ IDEA中使用Maven和Tomcat创建一个JSP项目,包括配置Maven依赖、设置Tomcat服务器、编写JSP页面、创建控制器和配置文件,以及项目的运行结果。
321 0
idea+maven+tomcat+spring 创建一个jsp项目
tomcat学习二:tomcat部署多个项目:不修改端口和修改端口 两种方式详解
这篇文章详细介绍了在Tomcat服务器上部署多个项目的方法,包括不修改端口和修改端口两种方式。
283 0
浅谈Tomcat和其他WEB容器的区别
Tomcat是一款轻量级的免费开源Web应用服务器,常用于中小型系统及并发访问量适中的场景,尤其适合开发和调试JSP程序。它不仅能处理HTML页面,还充当Servlet和JSP容器。相比之下,物理服务器是指具备处理器、硬盘等硬件设施的服务器,如云服务器,其设计目标是在处理能力、稳定性和安全性等方面提供高标准服务。简言之,Tomcat专注于运行Java应用,而物理服务器则提供基础计算资源。

推荐镜像

更多
AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等