1. 程式人生 > >eclipse沒有(新增)”Dynamic Web Project”選項的方法

eclipse沒有(新增)”Dynamic Web Project”選項的方法

第一種方法:

你安裝的是專門開發java專案的,而Dynamic Web Project  屬於J2EE技術,所以你要專門下載一個集成了J2EE外掛的Eclipse,(eclipse-jee-helios-SR2-win32),到eclipse官網下載相對應版本的IDE,

官網下載:http://www.eclipse.org/downloads/

選擇:Eclipse IDE for Java EE Developers

第二種方法:

為當前的eclipse安裝Java EE開發外掛。如下:

For this tutorial I am using Eclipse Kepler(4.3) since it is the latest version right now but the steps work same for Eclipse Juno(4.2), Indigo(3.7), Helios(3.6). If you have a version older than Helios then I would recommend that you upgrade to Kepler since versions older than Helios are not supported. 

Here are the steps to download and setup Eclipse.

Start Eclipse and open the New Project Wizard. Currently it would not contain the Web folder and the Dynamic Web Project option.

Click Cancel. In the top Menu bar click on Help -> Install New Software

安裝嚮導被開啟。在安裝嚮導的視窗, 點選”Work With”下拉,根據你的eclipse版本名選擇

“http://download.eclipse.org/releases/kepler“(如果你是 Eclipse Kepler版本)

OR “http://download.eclipse.org/releases/juno”(如果你是 Eclipse Juno版本)

OR “http://download.eclipse.org/releases/indigo”(如果你是 EclipseIndigo版本)

OR “http://download.eclipse.org/releases/helios”(如果你是 Eclipse Helios版本) 

Note: If you do not see above site in the dropdown, you can add it using the add button.

eclipse會搜尋這個網址的所有軟體,並且顯示到下面的列表(建議使用代理,否則可能要花很長時間顯示和下載外掛,至於如何設定eclipse代理,請自行google)。

展開 “Web, XML, Java EE and OSGi Enterprise Development” 選項,並且將下面四個選項打上勾:

  • Eclipse Java EE Developer Tools
  • Eclipse Java Web Developer Tools
  • Eclipse Web Developer Tools
  • Eclipse XML Editors and Tools

然後點選”Next“。

依次點選“Next ”知道你看到 “ Review licences”的視窗。在這個視窗選擇 “I accept the terms of the licence agreement” 並且點選“Finish”。

eclipse會開始安裝新的軟體.

安裝完外掛之後, Eclipse會要求你重啟eclipse,選擇“yes”。

重啟eclipse之後, 開啟新建專案的面板,就可以看到 Web資料夾 和 “Dynamic Web Project” 選項了。

在eclipse配置tomcat的時候,我發現在Eclipse—Preferences—server—Runtime Environment中,點選“Add”按鈕,裡面看不到tomcat的,只有個“J2EE Runtime Library”。

解決辦法:

  1. Help -> Install New Software
  2. Choose “Luna – http://download.eclipse.org/releases/Luna” site
  3. Expand “Web, XML, and Java EE Development”
  4. Check JST Server Adapters (version 3.2.2) and  JST Server Adapters Extentions

安裝完後,就能在 Server Runtime Environments的Add按鈕中看到tomcat的選項了。

EDIT: With Eclipse 3.7 Indigo Classic, Eclipse Kepler and Luna, the steps are the same (with appropriate update site) but you need both JST Server Adapters and JST Server Adapters Extentions to get the Server Runtime Environment options.