2025-05-17

 

1、安裝jdk

    安裝完成之後配置java環境變量:

    JAVA_HOME:jdk安裝路徑;

    Path:%JAVA_HOME%\bin;

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

    cmd-java、javac、java -version進行測試。

2、到www.eclipse.org下載最新eclipse for javaee版本的Eclipse,並配置JRE和工作空間字符集:

    window-preferences-java-installed JREs

    Window-Preferences-General-Workspace

3、安裝tomcat,並配置tomcat

    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/驗證

4、創建並運行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圖標即可;

5、將已有的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即可

6、安裝svn插件

    help-install new software

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

7、安裝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文件)

8、安裝PropEdit插件(處理國際化編輯Unicode資源文件使用native2ascii編碼)

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

    右鍵properties文件,open with propertiesEditor,直接編譯即可

 

9、安裝findbugs插件

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

 

10、安裝jetty插件

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

 

11、配置maven+jetty項目調試環境

    debug-debug configurations-name(調試服務器名稱) & base directory(選擇項目路徑) & goals(jetty:run 運行命令) & add parameter(name:wd3config.development value:true)-apply

 

12、通過svn檢出maven+jetty項目

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

 

13、反編譯軟件

    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

14、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

15、easyExplorer 快速打開項目硬盤文件夾

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

    下載後放到eclipse下plugins中即可

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *