Google Web Toolkit on Mac OS X

by Brian Jepson

The Google Web Toolkit looks cool, but at the moment, Mac users might think they are locked out: on the download page, you can choose Windows or Linux. And if you download either one, you might be discouraged to find shared libraries in the form of .dll or .so files.

The Linux version does work on the Mac, but you won't be able to run it in hosted mode since that mode depends on SWT (that's what those shared libraries are there for, apparently). Hosted mode gives you more debugging power, so you are giving that up on the Mac.

To use web mode, run the autogenerated MyApplication-compile script to compile it all to JavaScript, then open MyApplication.html in a browser.

Here are the steps to unpack it and create your first app. I haven't gone beyond these basics, but it should be enough to get you started:

$ tar xfz gwt-linux-1.0.20.tar.gz

$ cd gwt-linux-1.0.20/

$ ./applicationCreator com.mycompany.client.MyApplication
Created directory /Users/bjepson/src/gwt-linux-1.0.20/src
[etc., etc.]

$ ./MyApplication-compile
Output will be written into ./www/com.mycompany.MyApplication
Copying all files found on public path
Compilation succeeded

$ cd www/com.mycompany.MyApplication/

$ open MyApplication.html

Once you've done that, you should see something like the following:


2006-05-21 07:07:25
Thanks for putting out a workaround.
Renganathan K
2006-06-27 00:47:02

I use gwt on Mac systems. I did as you said. used Linux jar for GWT on my Mac system. While compiling I am getting error.
The way I compiled it in my Mac terminal is as follows.

java -cp "dirname $0/src:/Users/company/appdir/Software/gwt-linux/gwt-linux-1.0.21/gwt-user.jar:/Users/company/appdir/Software/gwt-linux/gwt-linux-1.0.21/gwt-dev-linux.jar:/Users/company/appdir/workspace/gwt_works/FirstProj/bin:/Users/company/appdir/workspace/gwt_works/FirstProj/bin/com/company/MyApplication.gwt.xml" -out "dirname $0/www" "$@";

It gives me the following error. It does not compile to the output directory.

Finding entry point classes
[ERROR] Unable to find type ''
[ERROR] Hint: Check that the type name '' is really what you meant
[ERROR] Hint: Check that your classpath includes all required source roots
[ERROR] Build failed

but under . bin/com/company folder, MyApplication.gwt.xml exists.

Can you please help out on should have gone wrong here.

Brian Jepson
2006-06-27 04:03:26
Renganathan K,

I noticed you used your own compilation command. If you're going to use dirname in your compile, you should put it in backticks `` so it's evaluated properly by the shell.

Did you try ./MyApplication-compile instead? What happens when you follow the instructions I posted? Does it work then?

- Brian

Renganathan K
2006-06-27 04:58:16
Hi Brian

Thanks for the input. I tried executing the ./MyApplication-compile command from the Terminal of Mac. and i got the compiled output. Thanks a lot again.

Renganathan K

2006-07-02 04:50:50
Your pictures are great. nokia6630