初学Eclipse,完全沒接觸過eclipse的人 不妨看看吧[ZT]

类别:Java 点击:0 评论:0 推荐:
初学Eclipse,完全沒接觸過eclipse的人 不妨看看吧[ZT]

《First-下載》

首先去www.eclipse.org下載eclipse

screen.width-333) {this.width=screen.width-333;this.alt='在新窗口中打开';}" border=0>
在Downloads --> Main Eclipse Download Site --> 3.0 Latest Releases
再依自己的系統下載版本

《Second-安裝》
下載後直接將檔案解壓縮至C:\或其他目錄,會自動產生eclipse的目錄

《Third-開啟》
在eclipse.exe點兩下會產生workspace目錄,往後的專案檔都會預設放置在此
另外也可以將eclipse.exe執行檔和workspace目錄傳送到桌面當作捷徑,方便作業

《Fourth-開始編輯》
1.從File選New-->Project
screen.width-333) {this.width=screen.width-333;this.alt='在新窗口中打开';}" border=0>
2.選擇Java Project按Next輸入Project Name(像是Hello)
screen.width-333) {this.width=screen.width-333;this.alt='在新窗口中打开';}" border=0>
3.Project layout 有兩個選項,差別在於第一個會將原始碼與編譯好的程式碼放置在專案目錄下,另一個則是分開放在src與bin資料夾內
4.下一步可先採用預設直接點選Finish
5.完成後,從New --> class
screen.width-333) {this.width=screen.width-333;this.alt='在新窗口中打开';}" border=0>
輸入 class name,並自行依需要選擇下面選項,Eclipse就會自動幫你產生一個class檔
screen.width-333) {this.width=screen.width-333;this.alt='在新窗口中打开';}" border=0>
像是降~

  Code: [Copy to clipboard]   /*
* Created on 2004/3/22
*
* To change the template for this generated file go to
* Window - Preferences - Java - Code Generation - Code and Comments
*/
/**
* @author Administrator
*
* To change the template for this generated type comment go to
* Window - Preferences - Java - Code Generation - Code and Comments
*/
public class Hello {
    public static void main(String[] args) {
    }
}
6.現在就可以開始寫程式了
eclipse有一個很棒的功能就是按Alt + /就會有程式碼完成功能
或是像降打System接著打.時停一下就會出現相關程式碼超級方便!!
另外如果打sysout再按Alt + /,就會自動跑出System.out.println();喔~
7.程式寫完後,在程式檔上按右鍵,選擇Run --> Java Application,或在Run選單下選Run As選擇要執行的檔案就可以了
screen.width-333) {this.width=screen.width-333;this.alt='在新窗口中打开';}" border=0>
如果按Ctrl + F11,就可以重新執行一次剛才跑過的程式
8.另外介紹一個更棒的功能,就是除錯
先在想要讓除錯器停下來的地方設中斷點
就是在編輯器左方的深灰色區域點兩下滑鼠,就會出現一個藍點表示中斷點
執行時選擇Run的第一個Debug As然後執行程式
Eclipse執行的時候就會停在中斷點的地方,並顯示除錯的畫面
接著可以按Step Into一步步執行中斷點下方的程式碼
還可以由右上方的Variables看變數值的改變
也可以在Expression View中點選某一變數按右鍵,選Watch
此變數及其值會出現在此
9.使用者設定可以在Window --> Preferences中更改

本文地址:http://com.8s8s.com/it/it13674.htm