準備條件:
1. 安裝JDK
2. 安裝eclipse
3. 安裝myeclipse
4. 安裝web伺服器:tomcat / weblogic / jboss 等
開啟eclipse,點擊“視窗-->喜好設定”,選擇“MyEclipse-->Application Servers”,選擇一種需要的伺服器。
例:
weblogic配置:
一、
weblogic server選項中,選擇“Enable”
BEA home directory: C:/bea
WebLogic installation directory: C:/bea/weblogic81
Admin username: system (預設)
Admin password: password (預設)
Execution domain root: C:bea/user_projects/domains/mydomain (根據自己的域寫)
Execution domain name: mydomain (根據自己的域寫)
Execution server name: mydomainServer (根據自己的域寫)
Hostname: PortNumber: localhost:7001 (預設)
點擊“應用”按鈕
二、
展開"WebLogic8",點擊“JDK”,其中預設的“WLS JDK name”是“j2re1.4.2_08”(根據JDK版本不同而不同)。如果按預設配置,web應用程式在選擇伺服器的時候,會出現以下錯誤資訊:
the selected server is enabled, but is not configured properly. Deployment to it will not be permitted until the problem is corrected. Please navigate to the server preference pages and verify the field with the prompt: WLS JDK name
解決方案:
點擊“Add...”,在“JRE主目錄”中,選擇JDK的安裝目錄,如:“C:/j2sdk1.4.2_08”
點擊“確定”按鈕,操作完成。
接著就可以在eclipse中使用web伺服器了...