1.下载GWT
http://code.google.com/intl/zh-CN/webtoolkit/download.html
目前版本:GWT1.7
直接连接地址:
http://google-web-toolkit.googlecode.com/files/gwt-windows-1.7.0.zip
2.下载GWT的ECLIPSE插件:cypal.studio.for.gwt-1.0
地址:http://code.google.com/p/cypal-studio/
http://cypal-studio.googlecode.com/files/cypal.studio.for.gwt-1.0.zip
下载后直接解压到eclipse的plugins目录下即可。
3.配置eclipse的GWT Home目录:
Eclipse>Window>Preferences>Cypal Studio,选择解压的GWT解压目录。
4.编写简单实例
新建一个动态 web项目, File—New—Other—Web—Dynamic Web Project,在 Configurations中选择 Cypal Studio for GWT,其他的默认即可。 注意,Target Runtime 一定要为 ,不要选择服务器,实例在GWT自己的环境下运行。
创建MODULE模型,项目上点击右键 New—Other—Cypal Studio—Module,输入包名 com.lc.gxt,类名 Test。
在Test.java的onModuleLoad()方法中加入Window.alert(“Hello World!”);
配置运行环境
选择 Run—Run Configurations—Gwt Hosted Mode Application,选择 New,新建一个运行实例new_gxt,在 Project中选择 Gxt, Module会自动选择所要运行的模型类Test.java。
运行结果: