- OS : Windows 7 (X64)
- Java : jdk1.6.0_31 (X32)
- Eclipse : Eclipse Juno (X32)
- Tomcat : apache-tomcat-7.0.32 (zip)
(一)安裝JAVA JDK 於 C:\Program Files (x86)\Java\jdk1.6.0_31
(二)解壓縮 Eclipse Juno 於 C:\junoEclipse\eclipse
(三)解壓縮 Tomcat 於 D:\apache-tomcat-7.0.32
(四)Eclipse 設定
- 設定 Install JREs:
Eclipse : Window >> Preferences
Preferences : Java >> Installed JREs >> Add...
JRE Type : Standard VM >> Next >
JRE Definition : JRE home = C:\Program Files (x86)\Java\jdk1.6.0_31, Remove Eclipse JRE >> Finish
- 設定 Server Runtime Environments
Eclipse : Window >> Preferences
Preferences : Server >> Runtime Environments >> Add...
New Server Runtime Environment : select Apache Tomcat v7.0, 勾選 Create a new local Server >> Next>
- 設定 Tomcat Server:
Eclipse : Window >> Show View >> Servers
Servers : 以滑鼠右鍵點選 Tomcat v7.0 Server as localhost >> Open
Tomcat v7.0 Server as localhost :
- Server locations:
點選 Use Tomcat installation(takes control of Tomcat installation),
Deploy Path=webapps
- server Options :
勾選Publish module contexts to separate XML files,
勾選Modules auto reload by default,
關閉Tomcat v7.0 Server視窗,Save Yes
- Server locations:
- 新增 Dynamic Web Project:
Eclipse : File >> New >> Dynamic Web Project
New Dynamic Web Project : Project name=myWeb2, 其他使用預設值 >> Finish
- 新增 Hello Html :
Project Explorer :以滑鼠右鍵點選myWeb2 >> New >> HTML File >> File name=index.html >> Finish
index.html :在後輸入 Hello ! Html >> File >> Save
- 將 Web 專案佈屬到 Tomcat Server:
Eclipse : Window >> Show View >> Servers
Servers : 以滑鼠右鍵點選 Tomcat v7.0 Server as localhost >> Start
Servers : 以滑鼠右鍵點選 Tomcat v7.0 Server as localhost >> Add and Remove...
Add and Remove : Available: myWeb2 >> Add >> Finish
沒有留言:
張貼留言