Eclipse3.1下JFace和SWT工程環(huán)境配置方法
Posted on 2006-02-17 08:57 fortune 閱讀(840) 評(píng)論(2) 編輯 收藏 所屬分類(lèi): java技術(shù)假設(shè)eclipse目錄為d:\eclipse已經(jīng)建好一個(gè)名為MyProject的工程,下面將介紹如何為該工程設(shè)置正確的環(huán)境以使用JFace/SWT開(kāi)發(fā)GUI程序。
1.為SWT創(chuàng)建類(lèi)路徑變量。在Eclipse中右鍵選中MyProject,選擇Properties,選擇左側(cè)的Java Build Path,選擇Libraries,點(diǎn)擊Add Variable,來(lái)添加各種變量,用它們來(lái)表示編譯時(shí)所需的各個(gè)庫(kù)(*.jar)。繼續(xù)Configure Variables,然后點(diǎn)擊New按鈕,添加路徑變量,name:SWT_LIB,file:d:/eclipse/plugins/org.eclipse.swt.win32.win32.x86_3.1.0.jar。
2.用上面相同的方法,創(chuàng)建JFACE_LIB變量,name: JFACE_LIB,file: d:/eclipse/plugins/org.eclipse.jface_3.1.0.jar;創(chuàng)建BOOT_LIB變量,name: BOOT_LIB,file: d:/eclipse/plugins/org.eclipse.core.boot_3.0.0.jar;創(chuàng)建RUNTIME_LIB變量,name: RUNTIME_LIB,file: d:/eclipse/plugins/org.eclipse.core.runtime_3.1.0.jar;創(chuàng)建WORKBENCH_LIB變量,name: WORKBENCH_LIB,file: d:/eclipse/plugins/org.eclipse.ui.workbench_3.1.0.jar。
3.在Properties/Java Build Path/Libraries中點(diǎn)擊Add Variable,選中剛才添加的幾個(gè)變量,加入到工程中。
4.解壓d:/eclipse/plugins/org.eclipse.swt.win32.win32.x86_3.1.0.jar,將其中的swt-win32-3135.dll拷貝到$PATH環(huán)境變量指向的目錄。
1.為SWT創(chuàng)建類(lèi)路徑變量。在Eclipse中右鍵選中MyProject,選擇Properties,選擇左側(cè)的Java Build Path,選擇Libraries,點(diǎn)擊Add Variable,來(lái)添加各種變量,用它們來(lái)表示編譯時(shí)所需的各個(gè)庫(kù)(*.jar)。繼續(xù)Configure Variables,然后點(diǎn)擊New按鈕,添加路徑變量,name:SWT_LIB,file:d:/eclipse/plugins/org.eclipse.swt.win32.win32.x86_3.1.0.jar。
2.用上面相同的方法,創(chuàng)建JFACE_LIB變量,name: JFACE_LIB,file: d:/eclipse/plugins/org.eclipse.jface_3.1.0.jar;創(chuàng)建BOOT_LIB變量,name: BOOT_LIB,file: d:/eclipse/plugins/org.eclipse.core.boot_3.0.0.jar;創(chuàng)建RUNTIME_LIB變量,name: RUNTIME_LIB,file: d:/eclipse/plugins/org.eclipse.core.runtime_3.1.0.jar;創(chuàng)建WORKBENCH_LIB變量,name: WORKBENCH_LIB,file: d:/eclipse/plugins/org.eclipse.ui.workbench_3.1.0.jar。
3.在Properties/Java Build Path/Libraries中點(diǎn)擊Add Variable,選中剛才添加的幾個(gè)變量,加入到工程中。
4.解壓d:/eclipse/plugins/org.eclipse.swt.win32.win32.x86_3.1.0.jar,將其中的swt-win32-3135.dll拷貝到$PATH環(huán)境變量指向的目錄。