如何在Eclipse或者Myeclipse中使用tomcat(配置tomcat,发布web项目)?(图文详解)(很实用)
前期博客
Eclipse里的Java EE视图在哪里?MyEclipse里的Java EE视图在哪里?MyEclipse里的MyEclipse Java Enterprise视图在哪里?(图文详解)
如何在Myeclipse中使用tomcat(配置tomcat,发布web项目)?
首先,打开MyEclipse,点击菜单栏中 window–>preference –>Myeclipse –>servers->tomcat(也可以window-preference –>搜索tomcat)
选择你自己需要的tomcat (我的是tomcat 7.x)前提是你已经有自己解压好的tomcat。
大家,还没有在本地里安装好tomcat的博友,请移步
Tomcat *的安装和运行(绿色版和安装版都适用)
更多深入学习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 )

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



七月 , :: 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server version: Apache Tomcat/7.0.
七月 , :: 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server built: Apr :: UTC
七月 , :: 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server number: 7.0.69.0
七月 , :: 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: OS Name: Windows
七月 , :: 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: OS Version: 6.1
七月 , :: 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Architecture: amd64
七月 , :: 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Java Home: C:\Program Files\Java\jdk1..0_51\jre
七月 , :: 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: JVM Version: 1.7.0_51-b13
七月 , :: 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: JVM Vendor: Oracle Corporation
七月 , :: 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: CATALINA_BASE: D:\SoftWare\apache-tomcat-7.0.
七月 , :: 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: CATALINA_HOME: D:\SoftWare\apache-tomcat-7.0.
七月 , :: 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dcatalina.home=D:\SoftWare\apache-tomcat-7.0.
七月 , :: 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dcatalina.base=D:\SoftWare\apache-tomcat-7.0.
七月 , :: 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Djava.endorsed.dirs=D:\SoftWare\apache-tomcat-7.0./common/endorsed
七月 , :: 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Djava.io.tmpdir=D:\SoftWare\apache-tomcat-7.0.\temp
七月 , :: 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Djava.library.path=C:\Program Files\Java\jdk1..0_51\bin;D:\SoftWare\apache-tomcat-7.0.\bin
七月 , :: 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dsun.io.useCanonCaches=false
七月 , :: 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
信息: Loaded APR based Apache Tomcat Native library 1.1. using APR version 1.5..
七月 , :: 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
信息: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
七月 , :: 下午 org.apache.catalina.core.AprLifecycleListener initializeSSL
信息: OpenSSL successfully initialized (OpenSSL 1.0.1m Mar )
七月 , :: 下午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["http-apr-8080"]
七月 , :: 下午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["ajp-apr-8009"]
七月 , :: 下午 org.apache.catalina.startup.Catalina load
信息: Initialization processed in ms
七月 , :: 下午 org.apache.catalina.core.StandardService startInternal
信息: Starting service Catalina
七月 , :: 下午 org.apache.catalina.core.StandardEngine startInternal
信息: Starting Servlet Engine: Apache Tomcat/7.0.
七月 , :: 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory D:\SoftWare\apache-tomcat-7.0.\webapps\docs
七月 , :: 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory D:\SoftWare\apache-tomcat-7.0.\webapps\docs has finished in ms
七月 , :: 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory D:\SoftWare\apache-tomcat-7.0.\webapps\examples
七月 , :: 下午 org.apache.catalina.core.ApplicationContext log
信息: ContextListener: contextInitialized()
七月 , :: 下午 org.apache.catalina.core.ApplicationContext log
信息: SessionListener: contextInitialized()
七月 , :: 下午 org.apache.catalina.core.ApplicationContext log
信息: ContextListener: attributeAdded('org.apache.jasper.compiler.TldLocationsCache', 'org.apache.jasper.compiler.TldLocationsCache@401eea7c')
七月 , :: 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory D:\SoftWare\apache-tomcat-7.0.\webapps\examples has finished in , ms
七月 , :: 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory D:\SoftWare\apache-tomcat-7.0.\webapps\host-manager
七月 , :: 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory D:\SoftWare\apache-tomcat-7.0.\webapps\host-manager has finished in ms
七月 , :: 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory D:\SoftWare\apache-tomcat-7.0.\webapps\manager
七月 , :: 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory D:\SoftWare\apache-tomcat-7.0.\webapps\manager has finished in ms
七月 , :: 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory D:\SoftWare\apache-tomcat-7.0.\webapps\ROOT
七月 , :: 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory D:\SoftWare\apache-tomcat-7.0.\webapps\ROOT has finished in ms
七月 , :: 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory D:\SoftWare\apache-tomcat-7.0.\webapps\sport-web
七月 , :: 下午 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.
七月 , :: 下午 org.apache.catalina.core.ApplicationContext log
信息: No Spring WebApplicationInitializer types detected on classpath
七月 , :: 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory D:\SoftWare\apache-tomcat-7.0.\webapps\sport-web has finished in , ms
七月 , :: 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["http-apr-8080"]
七月 , :: 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["ajp-apr-8009"]
七月 , :: 下午 org.apache.catalina.startup.Catalina start
信息: Server startup in ms
http://localhost:8080/***
贴图
方式二、MyEclipse自带的MyEclipse Tomcat

贴图
注意:别忘记,还需在
D:\Code\MyEclipseHadoopCode\***\WebRoot
***是项目名
我的项目编写的代码是在D:\Code\MyEclipseHadoopCode\***\

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






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


接着,来
如何发布Eclipse中的web项目
直到这里,你的server中就有你的项目了

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



七月 , :: 下午 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.
七月 , :: 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server version: Apache Tomcat/7.0.
七月 , :: 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server built: Apr :: UTC
七月 , :: 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server number: 7.0.69.0
七月 , :: 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: OS Name: Windows
七月 , :: 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: OS Version: 6.1
七月 , :: 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Architecture: amd64
七月 , :: 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Java Home: C:\Program Files\Java\jdk1..0_51\jre
七月 , :: 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: JVM Version: 1.7.0_51-b13
七月 , :: 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: JVM Vendor: Oracle Corporation
七月 , :: 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: CATALINA_BASE: D:\Code\eclipseMarsCode\.metadata\.plugins\org.eclipse.wst.server.core\tmp0
七月 , :: 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: CATALINA_HOME: D:\SoftWare\apache-tomcat-7.0.
七月 , :: 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dcatalina.base=D:\Code\eclipseMarsCode\.metadata\.plugins\org.eclipse.wst.server.core\tmp0
七月 , :: 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dcatalina.home=D:\SoftWare\apache-tomcat-7.0.
七月 , :: 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dwtp.deploy=D:\Code\eclipseMarsCode\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps
七月 , :: 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Djava.endorsed.dirs=D:\SoftWare\apache-tomcat-7.0.\endorsed
七月 , :: 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dfile.encoding=GBK
七月 , :: 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
信息: Loaded APR based Apache Tomcat Native library 1.1. using APR version 1.5..
七月 , :: 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
信息: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
七月 , :: 下午 org.apache.catalina.core.AprLifecycleListener initializeSSL
信息: OpenSSL successfully initialized (OpenSSL 1.0.1m Mar )
七月 , :: 下午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["http-apr-8080"]
七月 , :: 下午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["ajp-apr-8009"]
七月 , :: 下午 org.apache.catalina.startup.Catalina load
信息: Initialization processed in ms
七月 , :: 下午 org.apache.catalina.core.StandardService startInternal
信息: Starting service Catalina
七月 , :: 下午 org.apache.catalina.core.StandardEngine startInternal
信息: Starting Servlet Engine: Apache Tomcat/7.0.
七月 , :: 下午 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.
七月 , :: 下午 org.apache.catalina.core.ApplicationContext log
信息: No Spring WebApplicationInitializer types detected on classpath
七月 , :: 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["http-apr-8080"]
七月 , :: 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["ajp-apr-8009"]
七月 , :: 下午 org.apache.catalina.startup.Catalina start
信息: Server startup in ms
启动成功后再到浏览器中输入:http://localhost:8080/*** 。回车,如果不出错的话应该应该就能显示出的默认页面了。
参考
http://jingyan.baidu.com/article/d8072ac4641c19ec94cefd7b.html(MyEclipse怎样部署WEB程序)
Servlet开发(一)如何在Myeclipse 中使用tomcat(配置tomcat,发布web项目)
http://jingyan.baidu.com/article/a501d80c0c65baec630f5ef6.html(如何用tomcat发布自己的Java项目)
如何在Eclipse或者Myeclipse中使用tomcat(配置tomcat,发布web项目)?(图文详解)(很实用)的更多相关文章
- tomcat 加载顺序 web.xml文件详解
一. 1.启动一个WEB项目的时候,WEB容器会去读取它的配置文件web.xml,读取<listener>和<context-param>两个结点. 2.紧急着,容创建一个Se ...
- 如何在Eclipse和MyEclipse中安装SVN
在安装目录下,找到dropins文件夹将svn文件复制进去.
- Word在转PDF的过程中如何创建标签快速方便阅读(图文详解)
不多说,直接上干货! 选择如下 成功! 欢迎大家,加入我的微信公众号:大数据躺过的坑 人工智能躺过的坑 同时,大家可以关注我的个人博客: http://www.cnbl ...
- Linux(Centos)之安装tomcat并且部署Java Web项目
1.准备工作 a.下载tomcat linux的包,地址:http://tomcat.apache.org/download-80.cgi,我们下载的版本是8.0,下载方式如图: b ...
- Linux(Centos)之安装tomcat并且部署Java Web项目(转)
1.准备工作 a.下载tomcat linux的包,地址:http://tomcat.apache.org/download-80.cgi,我们下载的版本是8.0,下载方式如图: b ...
- Linux(Centos)安装tomcat并且部署Java Web项目
步骤一.下载安装包 a. 下载tomcat linux安装包,地址:http://tomcat.apache.org/download-80.cgi , 我们下载的版本是8.0,下载方式如图: b ...
- 【Tomcat-原】如何在Myeclipse中添加本地的Tomcat
2014-10-27 16-24-09 liulin 说明: Myeclipse中自带Tomcat,如果不想用Myeclipse自带的Tomcat,可以使用本地的Tomcat, 下面将介绍如何在My ...
- eclipse中tomcat使用add and remove无法发布web项目
继上次启动eclipse中的tomcat报classNotFound的问题后,这次又遇到新问题.就是右键点击tomcat使用add and remove发布web项目至tomcat后,启动tomcat ...
- 怎么eclipse或MyEclipse中添加javaSe的源码
怎么eclipse或MyEclipse中添加javaSe的源码 有时在eclipse里我们调用java提供给我们的方法,我们有时需要查看java提供给我们的调用方法的源码或java提供给我们的核心类的 ...
随机推荐
- java中文乱码问题的处理方式
URL访问java时. 注意: URL: 编码二次 URLEncoder.encode(URLEncoder.encode(searchKey, "utf-8"),"ut ...
- Android定位(是否使用GPS进行定位)
TencentLocationRequest request = TencentLocationRequest.create(); request.setRequestLevel(TencentLoc ...
- SHARP AR-2048D/2348D
http://www.sharp.cn/printer/AR-2048D%7C2348D/support/download.html
- ArcGIS Python 编码问题
吐槽一下ArcGIS自带的 Python IDE, 没有代码补全 没有函数提示 没有代码折叠 没有行号 撤销操作还有问题 字符编码还有各种问题 ......... 花了2天时间才琢磨出来的经验 环 ...
- JavaScript错误处理和堆栈追踪
转自:https://github.com/dwqs/blog/issues/49 有时我们会忽略错误处理和堆栈追踪的一些细节, 但是这些细节对于写与测试或错误处理相关的库来说是非常有用的. 例如这周 ...
- 一个Navi过程下多个DocumentCompleted事件问题的解决的方法
7.16 Marked to Write.... 七月份马克的一篇文章了,今天才想起来把他写完,呵呵. 原本是七月份用来做微博爬虫的,后来发现新浪对机器人的检測不好绕过,连简单地訪问都会被检測出来,后 ...
- 关于使用data()获取自定义属性出现undefined的说明
这应该是这个函数的一个bug,没有考虑到驼峰式的写法,当我写成驼峰式,即是有大小写的变量时就会出现没有定义的情况. 今天写个交互,需要用到自定义属性,因为这个自定义属性是当作字段用的,就直接用了字段名 ...
- 《深入理解Android 卷III》第四章 深入理解WindowManagerService
<深入理解Android 卷III>即将公布,作者是张大伟.此书填补了深入理解Android Framework卷中的一个主要空白.即Android Framework中和UI相关的部分. ...
- ionic/cordova 真机调试
android下简单,连接手机后,直接: myProjectPath>ionic run android ios下比较麻烦点,要先装ios-deploy: sudo npm install - ...
- 【HNOI模拟By lyp】Day1
1 xlk1.1 题目描述 给定一棵大小为 n 的无根树,求满足以下条件的四元组 (a, b, c, d) 的个数: 1. 1 ≤ a < b ≤ n 2. 1 ≤ c < d ≤ n 3 ...