1、進入www.apache.org網頁(注:圖中全部箭頭都依據從左到右,從上到下的規則)
![](http://static.javashuo.com/static/loading.gif)
2、向下拉網頁,而後以下圖操做
![](http://static.javashuo.com/static/loading.gif)
3、進入以後,在網頁的左邊選擇想要的Tomcat版本
![](http://static.javashuo.com/static/loading.gif)
4、選擇與本機相同系統類型的64位操系統
![](http://static.javashuo.com/static/loading.gif)
5、以後左下角會開始下載
![](http://static.javashuo.com/static/loading.gif)
下載完以後打開,解壓
![](http://static.javashuo.com/static/loading.gif)
6、打開解壓後的文件夾,會出現以下圖
![](http://static.javashuo.com/static/loading.gif)
7、雙擊startup.bat啓動服務
![](http://static.javashuo.com/static/loading.gif)
(一)普通方法
![](http://static.javashuo.com/static/loading.gif)
進入dos命令,輸入Java -version檢查jdk的版本是否一致
![](http://static.javashuo.com/static/loading.gif)
打開任務管理器,在進程中,出現java.exe則表示服務啓動成功
![](http://static.javashuo.com/static/loading.gif)
在瀏覽器中輸入127.0.0.1:8080或者localhost:8080進入端口,出現以下圖所示,表示成功
![](http://static.javashuo.com/static/loading.gif)
(二)減小啓動時間的小技巧
首先,點擊shutdown.bat來關閉服務\在任務管理器中結束java.exe的進程
![](http://static.javashuo.com/static/loading.gif)
而後,清空webapps中ROOT文件夾中的全部文件以及除了ROOT之外的其餘四個文件夾
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
再次點擊bin文件目錄下的startup.bat打開服務
![](http://static.javashuo.com/static/loading.gif)
這時,服務的啓動時間會比以前減小,可是再次進入瀏覽器會出現錯誤
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
出現錯誤以後,咱們能夠在ROOT目錄中添加一個index.jsp文件,並編輯裏面的內容,但只能填寫英文或數字,若是是中文則會出現亂碼。(這個問題暫時還不知道責怎麼解決)
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
8、想要別人在電腦上訪問你的網頁,首先要關閉你的防火牆,詳細以下
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
9、在dos命令中輸入ipconfig能夠顯示出本機的IP地址,而後讓其餘人在瀏覽器中輸入你的IP地址,就能夠訪問你的網頁了![](http://static.javashuo.com/static/loading.gif)
10、在eclipse中安裝tomcat
1》在server中添加tomcat
1.
![](http://static.javashuo.com/static/loading.gif)
2.
![](http://static.javashuo.com/static/loading.gif)
3.選擇與下載的Tomcat版本相同的,而後點擊下一步
![](http://static.javashuo.com/static/loading.gif)
4.
![](http://static.javashuo.com/static/loading.gif)
5.
![](http://static.javashuo.com/static/loading.gif)
2.建立一個動態網頁
1.前提,要把文件的eclipse中的文件編碼格式改成UTF-8,以下兩圖所示
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
2.首先要建立一個Dynamic web項目
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
3.
![](http://static.javashuo.com/static/loading.gif)
4.
![](http://static.javashuo.com/static/loading.gif)
5.
![](http://static.javashuo.com/static/loading.gif)
6.動態網頁項目建立成功
![](http://static.javashuo.com/static/loading.gif)
3.運行動態網頁
1.首先要運行服務
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
2.運行成功以後會出現以下界面![](http://static.javashuo.com/static/loading.gif)
3.建立一個jsp文件(也就是動態網頁)
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
4.在網頁body中輸入<%Sytem.out.println("hello world")%>,點擊上方綠色的運行按鈕
![](http://static.javashuo.com/static/loading.gif)
5.會出現以下圖所示,控制檯(console)會出現打印的內容,而網頁中不會顯示
![](http://static.javashuo.com/static/loading.gif)
6.若是想要在網頁中顯示,則只需把System去掉便可
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
感謝觀看!!!
注:本人菜鳥一個,這是我第一次作博客隨筆,也是課堂的筆記,一些小小的經驗,分享一下。感謝觀看的各位大神,請多多指導!java