This is going to become a real issue in September when Mac OS X 10.6
starts shipping.
Cross-compiling works but hosted mode is broken.
Darwin wolf 10.0.0b1 Darwin Kernel Version 10.0.0b1: Fri May 29
00:02:02 PDT 2009; root:xnu-1456~1/RELEASE_I386 i386
/System/Library/Frameworks/JavaVM.framework/Versions/1.5/Home/bin/java
-version
java version "1.6.0_13"
Java(TM) SE Runtime Environment (build 1.6.0_13-b03-208)
Java HotSpot(TM) 64-Bit Server VM (build 11.3-b02-81, mixed mode)
GWT 0.0.0 At revision 5593.
/System/Library/Frameworks/JavaVM.framework/Versions/1.5/Home/bin/java
You must use a Java 1.5 runtime to use GWT Hosted Mode on Mac OS X.
If I skip the Java 1.5 test... UnsatisfiedLinkError is thrown.
On Mac OS X, ensure that you have Safari 3 installed.
Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to
load required native library 'gwt-ll'. Detailed error:
/Users/Shared/tank/pub/devel/gwt/gwt-mac-0.0.0/libgwt-ll.jnilib: no
suitable image found. Did find: /Users/Shared/tank/pub/devel/gwt/gwt-
mac-0.0.0/libgwt-ll.jnilib: no matching architecture in universal
wrapper)
$ file /Users/Shared/tank/pub/devel/gwt/gwt-mac-0.0.0/libgwt-ll.jnilib
/Users/Shared/tank/pub/devel/gwt/gwt-mac-0.0.0/libgwt-ll.jnilib: Mach-
O universal binary with 2 architectures
/Users/Shared/tank/pub/devel/gwt/gwt-mac-0.0.0/libgwt-ll.jnilib (for
architecture i386): Mach-O bundle i386
/Users/Shared/tank/pub/devel/gwt/gwt-mac-0.0.0/libgwt-ll.jnilib (for
architecture ppc): Mach-O bundle ppc
libgwt-ll.jnilib is prebuilt so adding -arch x86_64 to jni/mac/
Makefile has no effect.
I managed to get gwt hosted mode to work by patching isJava5 to
always return true:
--- ./dev/mac/src/com/google/gwt/dev/BootStrapPlatform.java.orig
2009-06-21 00:42:40.000000000 +0700
+++ ./dev/mac/src/com/google/gwt/dev/BootStrapPlatform.java 2009-06-20
22:44:17.000000000 +0700
@@ -115,7 +115,7 @@
* 64-bit.
*/
private static boolean isJava5() {
- return System.getProperty("java.version").startsWith("1.5");
+ return true; /* System.getProperty("java.version").startsWith
("1.5"); */
}
/**
Then I hacked a 32bit only version of the 1.6 JRE by stripping the
x86_64 architecture:
cd /System/Library/Frameworks/JavaVM.framework/Versions
cp -pPR 1.6.0 1.6.0_32bit
cd !$
for bin in `find . -type f -exec file {} \; | grep 'Mach-O universal
binary with 2 architectures' | sed -e 's/:.*//' ` ; do ditto --rsrc --
arch i386 $bin $
bin.tmp.app ; mv $
bin.tmp.app $bin ; done
Added /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0_32bit/
Home in Eclipse -> Preferences -> Java -> Installed JRE and selected
it.
Really ugly fix but at least hosted mode works.