第零讲.0 eclipse开发环境(支持tomcat、maven、jetty、JBoss)

一、安装jdkphp

    安装完成以后配置java环境变量:html

    JAVA_HOME:jdk安装路径;java

    Path:%JAVA_HOME%\bin;web

    Classpath:.;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar;apache

    cmd-java、javac、java -version进行测试。api

 

二、到www.eclipse.org下载最新eclipse for javaee版本的Eclipse,并配置JRE和工做空间字符集:浏览器

    window-preferences-java-installed JREstomcat

    Window-Preferences-General-Workspace服务器

 

三、安装tomcat,并配置tomcatapp

    http://www.sysdeo.com/eclipse/tomcatPlugin.html下载最新tomcat插件,解压到eclipse/plugins目录,重启;

    window-customize perspective 配置eclipse工具条显示图标;

    window-preferences-tomcat 配置tomcat版本、目录以及server.xml文件路劲,展开后设置JVM Setting等选项;

    点击eclipse工具条上小猫图标,启动tomcat,浏览器访问http://localhost:8080/验证

 

四、建立并运行web工程

    new-project-web-dynamic web project-projectname & target runtime(配置tomcat服务器) & add project to working sets(加载工具集)-next & default ouput folder:WebRoot/WEB-INF/classes(修改编译文件输出路径)-next-content directory:WebRoot(修改jsp存放目录名称)-finish

    在工程webRoot下建立index.jsp文件;

    部署运行方式一:

    在eclipse下方显示窗口选择servers-new server-选择配置好的tomcat & next-将项目加入configred中-finish

    运行配置好的server,便可访问http://localhost:8088/web/index.jsp

    部署运行方式二:

    修改tomcat下server.xml配置文件,在host节点下配置Context节点

    <Context docBase="D:\workspace\maven\web\WebRoot" path="/web"></Context>

    这样直接启动eclipse工具栏上tomcat图标便可;

 

五、将已有的web工程导入eclipse,没法找到javax.servlet.jsp.*的问题:

    须要从新导入servlet-api.jar, jsp-api.jar两个jar,在tomcat中有

    项目-properties-java build path-add externalJARs-在tomcat中选择servlet-api.jar, jsp-api.jar便可

 

六、安装svn插件

    help-install new software

    subclipse :http://subclipse.tigris.org/update_1.6.x

 

七、安装maven插件及配置

 

    首先下载maven http://maven.apache.org/download.html

    配置maven环境变量:

    M2_HOME:maven安装路径;

    path:%M2_HOME%\bin;

    echo %M2_HOME%、mvn -v 检验

    eclipse安装插件

    若是安装时不成功,抛出如下相似信息

Java代码 

Software being installed: Maven Integration  for  Eclipse (Required)  0.12 . 1.20110112 - 1712  

Java代码 

Software being installed: Maven Integration for Eclipse (Required) 0.12.1.20110112-1712 

 

    表示还差gef 插件,实际上gef已经装有,只是缺乏zest插件

    gef插件:http://download.eclipse.org/tools/gef/updates/interim/

    最小安装zest:http://www.eclipse.org/downloads/download.php?file=/tools/gef/downloads/drops/3.6.1/R201009132020/GEF-zest-3.6.1.zip

    下载后拷贝到eclipse相应目录便可

    m2e :http://m2eclipse.sonatype.org/sites/m2e

    m2e-extras :http://m2eclipse.sonatype.org/sites/m2e-extras

 

    配置

    首先将maven/conf目录下的setting.xml拷贝到~\.m2,和repository同级

    window-preferences-maven-installations(指定外部maven路径及全局setting文件)-user setting(选择用户自定义setting文件)

 

八、安装PropEdit插件(处理国际化编辑Unicode资源文件使用native2ascii编码)

    PropEdit :http://propedit.sourceforge.jp/eclipse/updates/

    右键properties文件,open with propertiesEditor,直接编译便可

 

九、安装findbugs插件

    findbugs :http://findbugs.cs.umd.edu/eclipse

 

十、安装jetty插件

    Jetty Launcher :http://jettylauncher.sourceforge.net/updates

 

十一、配置maven+jetty项目调试环境

    debug-debug configurations-name(调试服务器名称) & base directory(选择项目路径) & goals(jetty:run 运行命令) & add parameter(name:wd3config.development value:true)-apply

 

十二、经过svn检出maven+jetty项目

    import-maven-Checkout Maven Projects from scm-scm url(svn):svn地址-finish

 

1三、反编译软件

    jadclipse - http://sourceforge.net/projects/jadclipse/

    下载后放在eclipseplugin下

    须要依赖jad.exe文件,放在%JAVA_HOME%/bin下

    从新启动eclipse,重启后在window>preferences>java>JadClipse中,

    设置path to decompiler为jad.exe的全路径,既:%JAVA_HOME%/bin/jad.exe

 

1四、JBoss tools

    jboss - http://download.jboss.org/jbosstools/updates/development/

    相关插件不少,总共有43项,选择本身有用的安装,我选择了Web and Java EE Developement中的一部分

  

  Context and Dependency Injection Tools —— 上下文和依赖注入工具

 

    Hibernate Tools ——Hibernate 工具

    Jboss Tools RichFaces —— 可视化编辑,不过好像是针对JSF 编辑的

    JbossAS Tools ——JBoss 服务器工具,能够达到在eclipse 中进行项目部署、启动、关闭jboss server的做用

    Struts Tools ——Struts 工具,可是好像只支持到1.2 版的struts

    XULRunner —— 能够把web 程序作成相似桌面应用程序同样的效果

    Jboss Portlet ——JBoss 的门户网站,应该是针对这个门户网站程序开发用的

    Seam Tools —— 一种用于构建web 程序的新框架,整合了Ajax 、JSF 、EJB3 、Portlets 和BPM

 

1五、easyExplorer 快速打开项目硬盘文件夹

    下载地址:http://sourceforge.net/projects/easystruts/

    下载后放到eclipse下plugins中便可

相关文章
相关标签/搜索