在 Eclipse 上配置tomcat7.0并创建工程发布

Eclipse 是一个开放源代码的、基于Java的可扩展开发平台。我们想要在这个IDE上开发Java web程序,就需要配置我们WEB服务器apache-tomcat-7,以下是配置的步骤:

在配置之前先要安装好软件:

到官网下载:

apache-tomcat-7.0.52-windows-x86

jdk-7u51-windows-i586

eclipse-jee-kepler-SR2-win32

工具/原料

  •  windows

  •  tomcat

  •  jdk1.7

  •  eclipse-jee

方法/步骤

  1. 1

     打开 eclipse :

    在打开之前压迫先安装JDK1.7

    因为eclipse需要JDK

    在 Eclipse 上配置tomcat7.0并创建工程发布
  2. 2

     找到'window' 下   'Preferences’

    单击‘Preferences’

    在 Eclipse 上配置tomcat7.0并创建工程发布
  3. 3

     找‘Preferences‘   找到

    Server  --- Rntime Evironment

    在 Eclipse 上配置tomcat7.0并创建工程发布
  4. 4

     点击'add' ,新添加一个运行环境:

    在 Eclipse 上配置tomcat7.0并创建工程发布
  5. 5

     选中' Apache   Tomcat7'

    单击'next'

    在 Eclipse 上配置tomcat7.0并创建工程发布
  6. 6

     添加'Tomcat7' ,

    前提已经在硬盘上解压

    在 Eclipse 上配置tomcat7.0并创建工程发布
  7. 7

     选择 jre 运行环境

    这儿选jre7

    在 Eclipse 上配置tomcat7.0并创建工程发布
  8. 8

     点击'Finish' ,

    可以看到添加成功

    在 Eclipse 上配置tomcat7.0并创建工程发布
  9. 9

     现在来创建一个web工程测试一下:

    创建一个动态的Web 工程

    在 Eclipse 上配置tomcat7.0并创建工程发布
  10. 10

     输入工程名称:test

    选择web服务器:tomcat&

    选择servlet 版本:servlet3.0

     点击'Finish' 完成

    在 Eclipse 上配置tomcat7.0并创建工程发布
  11. 11

     查看工程

    在 Eclipse 上配置tomcat7.0并创建工程发布
  12. 12

     在工程WebContent下创建一个index.jsp 文件:

     点击'Finish'   创建完成

     

    在 Eclipse 上配置tomcat7.0并创建工程发布
    在 Eclipse 上配置tomcat7.0并创建工程发布
  13. 13

    打开jsp文件:输入<h1>Hello Java!!!</h1>

    在 Eclipse 上配置tomcat7.0并创建工程发布
  14. 14

     保存内容,选中index.jsp,单击右键 选择Run As 在选择‘Run to Server '

    最后 点击'Finish'  

    在 Eclipse 上配置tomcat7.0并创建工程发布
    在 Eclipse 上配置tomcat7.0并创建工程发布
  15. 15

     启动服务器,并显示页面效果

    在 Eclipse 上配置tomcat7.0并创建工程发布
     

    在 Eclipse 上配置tomcat7.0并创建工程发布

posted @ 2015-04-02 15:22  徐本县  阅读(325)  评论(0编辑  收藏  举报