Eclipse 3.7 3.x SWT/Jface 开发环境搭建

1、准备工作

1.1、下载eclipse

http://www.eclipse.org/downloads/

目前的版本是eclipse-jee-indigo-SR1-win32

解压到d:\java\ide\eclipse-jee-indigo-SR1-win32


1.2、下载swt

http://eclipse.org/swt/

下载win32版本,结果是个zip文件


2、导入org.eclipse.swt 项目

运行eclipse,菜单中点击

file -> import -> general-exsiting projects to workspace -> next -> select archive file -> 选取下载的文——点击browse,会出现项目org.eclipse.swt->next

导入成功


3、新建SWT项目

file -> new -> javaproject ...

右键点击项目properties -> java build path -> projects -> 点add,把org.eclipse.swt项目加进来

OK,可以写SWT程序了


4、加入Jface支持

同3

properties -> java build path ->Libraries-> add external JARs..或Add Library

加入以下jar包:(jar包在eclipse安装目录的plugins子目录中找)

org.eclipse.core.commands_xxx.jar

org.eclipse.core.runtime_xxx.jar

org.eclipse.equinox.common_xxx.jar //一定要加,不然会报java.lang.NoClassDefFoundError: org/eclipse/core/runtime/IProgressMonitor

org.eclipse.jface_xxx.jar

org.eclipse.jface.text_xxx.jar

org.eclipse.osgi_xxx.jar


为解决jface的中文问题,还要加上

org.eclipse.jface.nl1_3xx.jar

详见http://www.cnblogs.com/jifeng/archive/2011/10/15/2213615.html


OK

你可能感兴趣的:(eclipse)