Does GWT work in Snow Leopard?

12 views
Skip to first unread message

Jim Douglas

unread,
Aug 28, 2009, 12:52:02 PM8/28/09
to Google Web Toolkit
So what's the official word on GWT and Snow Leopard? The impression
that I get from Issue #2507, and earlier threads here, is that it's a
no-go; copying Java 5 from Leopard isn't a solution.

http://code.google.com/p/google-web-toolkit/issues/detail?id=2507

http://groups.google.com/group/google-web-toolkit/browse_thread/thread/c1bb7dfa39631a69/9a60f0fea9028ca2?lnk=gst&q=snow+leopard#9a60f0fea9028ca2

Steven Jay Cohen

unread,
Aug 28, 2009, 1:07:42 PM8/28/09
to Google Web Toolkit
All macs, aside from XServes, will boot in 32-bit mode under Snow
Leopard. And, all macs will ship with Java v1.4-1.6

All you need to do is set Eclipse to use Java 1.5 and the problem is
gone.

On Aug 28, 12:52 pm, Jim Douglas <jdoug...@basis.com> wrote:
> So what's the official word on GWT and Snow Leopard?  The impression
> that I get from Issue #2507, and earlier threads here, is that it's a
> no-go; copying Java 5 from Leopard isn't a solution.
>
> http://code.google.com/p/google-web-toolkit/issues/detail?id=2507
>
> http://groups.google.com/group/google-web-toolkit/browse_thread/threa...

Jim Douglas

unread,
Aug 28, 2009, 3:40:28 PM8/28/09
to Google Web Toolkit
Just to clarify: Have you tested GWT (including hosted mode) in Snow
Leopard, and found it to work?

Snow Leopard *does not* ship with any version of Java 5:

http://developer.apple.com/mac/library/releasenotes/Java/JavaSnowLeopardRN/Introduction/Introduction.html

Java for Mac OS X 10.6
"Mac OS X 10.6 contains an Apple-provided Java SE 6 version of
1.6.0_15 for both 32 and 64-bit Intel architectures."

On Aug 28, 10:07 am, Steven Jay Cohen <steven.jay.co...@gmail.com>
wrote:

Gary S

unread,
Aug 28, 2009, 7:16:11 PM8/28/09
to Google Web Toolkit
I tried Soylatte 32 bit Java 6 for Mac
http://www.mail-archive.com/google-we...@googlegroups.com/msg10100.html

It failed because GWT won't start hosted mode if you run Java 6 on OS X

Dean S. Jones

unread,
Aug 29, 2009, 2:51:13 AM8/29/09
to Google Web Toolkit

Brian Dorry

unread,
Aug 29, 2009, 1:25:42 PM8/29/09
to Google Web Toolkit
Thanks Dean, that got me up and running again

Christian Goudreau

unread,
Aug 29, 2009, 4:51:55 PM8/29/09
to google-we...@googlegroups.com
Omg I wasn't aware of that ! Thanks a lot, I'm installing Snow Leopard monday, so it'll save me a lot of pain and time !
 
Christian

pohl

unread,
Aug 29, 2009, 6:18:46 PM8/29/09
to Google Web Toolkit

I noticed that it should be possible for Google to release a quick
patch of GWT 1.6.x that should allow users to run the legacy hosted
mode under a Java 1.6 VM now.

GWT's hosted mode, on the Mac, does an explicit check to ensure that
Java 1.5 is being used. This check only existed because under
Leopard, Java 1.5 is the only 32-bit JVM that was available. (I
believe 1.6 was 64-bit only).

I install Snow Leopard today, and it appears that while it only has
Java 1.6, it appears to have both a 64-bit mode and a 32-bit mode.
(Open "/Applications/Utilities/Java Preferences.app", and under the
"General" tab you can see both of these modes.)

So I think it should be possible to simply remove the explicit check
that GWT does for Java 1.5. I have never built GWT from source, but
I think I may try. Has anybody else attempted this?

James

unread,
Aug 30, 2009, 12:21:46 AM8/30/09
to Google Web Toolkit
Hi... I just wanted to add that along with the suggestions on:

http://wiki.oneswarm.org/index.php/OS_X_10.6_Snow_Leopard

I had to rename the "CurrentJDK" symbolic link in

/System/Library/Frameworks/JavaVM.framework/Versions/

from 1.6.0 to the (newly added) 1.5.0 because it appears that ant was
looking at the "CurrentJDK" for its version not the env.

miller

unread,
Aug 31, 2009, 10:04:04 AM8/31/09
to Google Web Toolkit
I agree that it should be a simple patch to allow 1.6 or 1.7 to run in
hosted mode with Java 1.6 VM on snow leopard....or is someone able to
provide instructions on how to perform the fix ourselves?

Michael Shantzis

unread,
Aug 31, 2009, 10:04:50 AM8/31/09
to Google Web Toolkit
The question I have is how high it is on google's list to release a
version of GWT that runs on snow leopard without any modifications.
I'm working in an environment where I'm testing jboss (which requires
java 1.6) and have had to jump through hoops to get my server running
1.6 and my GWT client running 1.5.

I'm sure they're already aware of this and it's certainly the case
that all the pieces are out there for them.

I'm patiently waiting!!!

mdwarne

unread,
Aug 31, 2009, 2:35:36 PM8/31/09
to Google Web Toolkit
Hi,
After watching a bunch of Googles GWT videos, and seminar speeches, I
noticed some of the presenters are using Macbooks.
I have to believe they are well aware of this issue.
Mike.

Sumit Chandel

unread,
Aug 31, 2009, 6:58:17 PM8/31/09
to google-we...@googlegroups.com
Hi all,

Hosted mode will be getting an exciting makeover soon, in the form of Out-Of-Process Hosted Mode (OOPHM). With OOPHM, hosted mode runs as a plugin to your favourite browser so that you can debug with the browser most familiar to you using whichever other debugging tools it offers while at the same time debugging your GWT code in hosted mode as you do now.

OOPHM is currently available in GWT trunk for those who want to give it a try (instructions linked below).

That said, OOPHM solves the problem of requiring 32-bit libraries that exists in other Mac builds where switching out to Java 1.5 was necessary. That means that OOPHM will also work perfectly well for Snow Leopard, or any other platform using any Java libraries, 32-bit or not.

Hopefully the workaround Dean linked to above will get you up and running until OOPHM comes out in the next major release. If that workaround doesn't work, please feel free to reply back and let us know.

Using OOPHM from trunk:
Hope that helps,
-Sumit Chandel

Jim Douglas

unread,
Aug 31, 2009, 7:35:59 PM8/31/09
to Google Web Toolkit
Hi Sumit,

That "workaround" is really not acceptable. Because Apple considers
the JVM to be part of the operating system, messing in those
directories amounts to hacking the O/S. It's unsafe, unsupported, and
can -- and probably will -- arbitrarily drop dead at any time with an
O/S update.

I could easily be missing something important, but it seems like this
should be a fairly easy thing for you to patch. My understanding is
that the issue with GWT is that you need a 32-bit JVM, and in Mac OS X
Leopard, the only way to get a 32-bit JVM is to use Java 5; the
Leopard Java 6 is 64-bit-only. But in Snow Leopard, you can invoke
Java 6 with "java -d32 ...", and you will get a 32-bit JVM. Wouldn't
this work for GWT hosted mode?

Regards,
Jim.

NIgel Leck

unread,
Sep 1, 2009, 5:10:11 AM9/1/09
to Google Web Toolkit
Ok, now... I've got to ask why Eclipse... the whole SWT thing seems to
be a bad idea from the outset.

Alex Moffat

unread,
Sep 3, 2009, 10:05:55 AM9/3/09
to Google Web Toolkit
I have another work around that involves changing the
BootStrapPlatform class in gwt-dev-mac.jar to remove the check for
java 1.5. If you do this then you can use java 1.6 with the -d32 flag
and it works fine. More details at http://development.lombardi.com/?p=1012

javacup

unread,
Sep 7, 2009, 4:12:28 PM9/7/09
to Google Web Toolkit
Hi All,

I followed the instructions from this page

http://wiki.oneswarm.org/index.php/OS_X_10.6_Snow_Leopard

but still I get

You must use a Java 1.5 runtime to use GWT Hosted Mode on Mac OS X.


I see some of you added hacks into the boot strap class. Does google
view this seriously and try to release a patch ASAP?

Thanks

On Sep 3, 7:05 am, Alex Moffat <alex.mof...@gmail.com> wrote:
> I have another work around that involves changing the
> BootStrapPlatform class in gwt-dev-mac.jar to remove the check for
> java 1.5. If you do this then you can use java 1.6 with the -d32 flag
> and it works fine. More details athttp://development.lombardi.com/?p=1012

Christian Goudreau

unread,
Sep 8, 2009, 2:21:44 PM9/8/09
to google-we...@googlegroups.com
I followed those instruction too, I don't get the message anymore, but hosted mode opens for like 2 second and close without any error.

Christian

Christian Goudreau

unread,
Sep 8, 2009, 2:45:21 PM9/8/09
to google-we...@googlegroups.com
Code 18 !! I forgot to change compiler compliance level for my project.

Regards,

Christian

Jim Douglas

unread,
Sep 8, 2009, 5:31:46 PM9/8/09
to Google Web Toolkit
Don't follow that horrific advice; it will break the next time get get
a Java update from Apple:

http://lists.apple.com/archives/java-dev/2009/Sep/msg00072.html

There are only two legitimate workarounds for this right now --
install a current build of GWT 2.0, or hack around the Java 5 check in
GWT 1.7 as described here:

http://development.lombardi.com/?p=1012

Pascal

unread,
Sep 8, 2009, 9:16:28 PM9/8/09
to Google Web Toolkit
Seriously, it takes around 20 seconds to copy the 1.5 directories over
and redo the symlinks. If an update from Apple came in and deleted
things, you'd need to spend another 20 seconds redoing things as all
they'd do is delete what you did. I'm sure there will be a fix out at
some point in the near future but in the interim, I can happily run
hosted mode on Snow Leopard and I wouldn't describe the workaround as
"horrific", it's just one directory and two symlinks.

Pascal

Jim Douglas

unread,
Sep 8, 2009, 10:30:50 PM9/8/09
to Google Web Toolkit
Hi Pascal,

If hacking system directories seems like an acceptable approach for
you, it's your system and your choice. My concern is that GWT
developers who come here looking for advice about getting GWT running
in Snow Leopard shouldn't be told that the correct solution is to hack
their operating system in ways that aren't supported or approved by
Apple.

As a general rule, it's rarely a good idea to advise anyone that the
fix for a problem is to hack around in system directories. It's
especially bad advice when it's not necessary. There's nothing
compelling about Snow Leopard that makes it urgent for anyone to
install it right this second. I'm more than happy to leave it sitting
here in the shrink wrap until I'm sure that I can install it and get
back to work without any disruptions. But if someone feels the need
to install it (or installed it without realizing it would break GWT),
there are other ways to get GWT running again that don't involve
hacking in Apple's JVM directories.

Regards,
Jim.

Pascal

unread,
Sep 8, 2009, 10:49:29 PM9/8/09
to Google Web Toolkit
Hi Jim,
All I was saying is that you seem to make this whole "hacking system
directories" way scarier than it is. I've changed things multiple
times over the years in "system directories" sometimes following
Apple's own advices. This particular instance is a completely harmless
copy.

Anyway, don't run snow leopard if you don't want to. But until a
proper fix is out, I much prefer (and some other people too I'm sure)
giving GWT the JDK 1.5 it expects rather than changing all my scripts
and eclipse projects to hack the gwt installation.

Regards,

Pascal

Sumit Chandel

unread,
Sep 14, 2009, 6:33:44 PM9/14/09
to google-we...@googlegroups.com
Hi All,

For those of you who have been running into problems using GWT 1.7 with Snow Leopard, please accept our humble apologies.

We are working on getting a GWT 1.7 point release out that will fix this issue so that you may use Snow Leopard with the JDK 1.6 32-bit libraries without having to tweak your OS settings.

Cheers,
-Sumit Chandel

Iain Shigeoka

unread,
Sep 17, 2009, 9:34:37 AM9/17/09
to Google Web Toolkit
Thanks Sumit. That's a great news.

For those of you who can't wait for the official patch release, I've
rebuilt the gwt-dev-mac.jar file from a checkout of the 1.7.0 tag.
I've made a very minor edit to the BootStrapPlatform.java file (diff
shown below) to check for 32-bit-ness rather than 1.5-ness. In order
to use this on Snow Leopard with 1.6 simply add the "-d32" option to
your java command line to use the 32-bit version of the jvm. Note that
since this is a temporary work around and a convenience for building
your own 1.7.0 patch I'm only going to keep the link active until the
official GWT patch is out. Let me know if anyone runs into any
problems.

http://www.messaginglogic.com/gwt-dev-mac.jar

-iain

ion $ svn diff BootStrapPlatform.java
Index: BootStrapPlatform.java
===================================================================
--- BootStrapPlatform.java (revision 6146)
+++ BootStrapPlatform.java (working copy)
@@ -69,8 +69,8 @@
* The following check must be made before attempting to
initialize Safari,
* or we'll fail with an less-than-helpful UnsatisfiedLinkError.
*/
- if (!isJava5()) {
- System.err.println("You must use a Java 1.5 runtime to use GWT
Hosted Mode on Mac OS X.");
+ if (!isJava32()) {
+ System.err.println("You must use a Java 32-bit runtime to use
GWT Hosted Mode on Mac OS X.");
System.exit(-1);
}

@@ -111,11 +111,11 @@
}

/**
- * Determine if we're using the Java 1.5 runtime, since the 1.6
runtime is
+ * Determine if we're using the Java 32-bit runtime, since the 1.6
runtime can be
* 64-bit.
*/
- private static boolean isJava5() {
- return System.getProperty("java.version").startsWith("1.5");
+ private static boolean isJava32() {
+ return System.getProperty("sun.arch.data.model").equals("32");
}

/**

Joe

unread,
Oct 22, 2009, 12:35:32 PM10/22/09
to Google Web Toolkit
Is there no update on this sorry issue? I keep expecting Google to do
The Right Thing - i.e., I click "update" in Eclipse and then
everything works - but after all this time with no solution my
paranoia gene has me thinking this may have more to do with Apple v.
Google issues than 64bit v. 32bit.

Joe

Bart Guijt

unread,
Oct 22, 2009, 3:42:45 PM10/22/09
to google-we...@googlegroups.com
GWT (1.7.1 and up!) *do* work in Snow Leopard. At the command
executing the HostedMode environment, add the -d32 option to tell the
VM to use the 32-bit version.

Bart Guijt

miller

unread,
Oct 22, 2009, 3:51:27 PM10/22/09
to Google Web Toolkit
I am using GWT2.0 in snow leopard and eclipse and it's working great.

Rajeev Dayal

unread,
Oct 28, 2009, 9:48:12 AM10/28/09
to google-we...@googlegroups.com
Hi Joe,

Are you still running into problems? Can you describe the exact problem you're seeing? Also, can you describe your system config (platform, GWT version, JDK version)?


Thanks,
Rajeev
Reply all
Reply to author
Forward
0 new messages