Using GWT on Mac OS X: How To Guide

366 views
Skip to first unread message

Mike Aizatsky

unread,
May 18, 2006, 8:14:39 PM5/18/06
to Google Web Toolkit
Hi!

I've made a substantial progress on using GWT browser on Mac OS X.
Here's the step by step guide to the things I've discovered so far:

1. Download the Mac OS X SWT from http://www.eclipse.org/swt/ . I've
used the 3.2RC2. Let me know if you try another version and get better
results

2. Download linux version of GWT

3. Add swt.jar to a classpath _BEFORE_ the gwt-dev jar

4. Add -Djava.library.path=<PATH_TO_SWT_LIBS> -XstartOnFirstThread VM
options

Start browser and have fun!

Remaining problems:

I didn't manage the embedded browser to do any sort of compilation. Let
me know if you master this.

Scott Blum

unread,
May 18, 2006, 11:58:35 PM5/18/06
to Google-We...@googlegroups.com
Hi Mike,

I think it's great that you're experimenting with this, and I don't
want to throw cold water on the pioneering spirit. But I also don't
want people to get frustrated banging on a problem that's a lot harder
than they may be expecting.

If it were simply a matter of getting the SWT Browser widget to run,
supporting Mac would have been a no brain decision. We like Mac! We
thought shipping with web mode support for Safari was really
important.

The problem in hosted mode is that there's a lot of magic going on
under hood. Getting the hosted browsers to make calls from Java to
JavaScript (and vice-versa) requires a lot of browser-specific low
level mojo. If you want to get an idea of just how much is going on,
you can setup a test like this (disclaimer- I'm typing this a text box
so it's probably not even syntactically correct):

void onModuleLoad() {
bar();
}

native void foo() /*-{
@your.class.Name::bar()();
}-*/;

void bar() {
boolean stopHere = true;
}

Put a breakpoint on the "stopHere" line and you can check out the
trippy call stack from onModuleLoad() to baz().

All this being said, any Safari ninjas with expertise on Safari's
embedding APIs: send me an email, I'd like to talk to you!

Scott Blum
GWT Engineer

walterc

unread,
May 19, 2006, 12:21:04 AM5/19/06
to Google Web Toolkit
i got the hosted browser up, in eclipse debug mode no less. my
application works great but i am not able to debug! any pointers?

Mike Aizatsky

unread,
May 19, 2006, 5:19:21 AM5/19/06
to Google Web Toolkit
Scott,

The Firefox is working flawlessly on Mac OS X. Why don't you use it too?

Scott Blum

unread,
May 20, 2006, 1:15:05 AM5/20/06
to Google-We...@googlegroups.com
On 5/19/06, Mike Aizatsky <mike.a...@gmail.com> wrote:
> Scott,
>
> The Firefox is working flawlessly on Mac OS X. Why don't you use it too?

That may be an option, but there's not a quick solution going this
route either. We're using Eclipse's SWT Browser widget to handle much
of the embedding for us. SWT Browser uses IE on Windows, Mozilla on
Linux, and Safari on Mac. So to do Mozilla on Mac, we'd have to
abandon SWT Browser or reimplement it for Mozilla/Mac. Either way
it'd be a fair amount of work.

Hosted mode for Mac is a priority, though I can't give a timeframe.

Scott Blum
GWT Engineer

Exabrial

unread,
May 21, 2006, 7:11:37 PM5/21/06
to Google Web Toolkit
I was curious to exactly how you got the hosted browser running... Lend
me a hand?

Reply all
Reply to author
Forward
0 new messages