Java Web (doesn’t) Start
Published by admin on Tuesday, December 1, 2009 - 06:10:56 - Filed under General, News, Development
That’s what you could call this wonderful technology that Sun created a while ago, to easily deploy rich clients on any(!) platform, providing that this platform have a proper JRE installed.
And true to its usual motto: ‘write once, debug everywhere!”, Java Web Start actually works great… most of the time. Because then again, you have the usual black sheep (Mac OS X, you’ve recognized it) that never really does thing like any other… One might say that it is a blessing, and sometimes that’s quite true, but when it comes to Java, I’m afraid it is rather a curse.
So, the first step was to make the DJ-NativeSwing demo app work from Java Web Start (JWS for those who love abbreviations) on all the target platform: Windows, Linux and Mac OS X. Armed with the latest SWT nightly build I thought it would be a piece of cake. True for Windows and Linux, although there was the occasionnal tweaking of a few flags, like the infamous -Dsun.awt.disableMixing=true (this one will really be used from Java 6u18 onwards, but I’ve tried it on early release, - to be on the safe side:).
On Mac OS X, I managed to make this work, on Leopard (10.5.8) using Java 5 32/64-bit and Java 6 64-bit only (because in its infinite wisdom, Apple decided not to release any Java 6 32-bit for Leopard, only for the new Snow Leopard - 10.6 - go figure!). So it was working fine on Leopard, and I decided that it would be nice to try it on Tiger (the previous beast: 10.4.x), because there is Java 5 available and I thought that it would be nice to be able to say to users that this stuff was compatible Tiger or more…
The only Tiger OS that I could put my hands on was located at my company’s office, but I figured that I could access it using VNC, except that the Mac was not accessible directly, so I had to go through a Terminal Server connection, then a VNC connection to get to it. Man, this was excruciatingly slow! Slow like being able to see each lines of files in the finder reveal one by one seconds after seconds.
Nevertheless, I was determined to make this test, now that I knew it was working on Leopard, right?
I can tell you, it has been a really really looOOong night! :{
I tried everything, integrating different version of the SWT libs in the jnlp, trying to tweak the order of the declarations, rebuilding the plugins, writing my own methods to deploy manually, I tried lots of different tricks… but never managed to make it work!
There were NullPointerException or UnsatisfiedLinkException spilled by Web Start, and nothing really revealing, some very mysterious messages from checkJRE() methods and other Web Start internals, and missing cocoa components. WTF?
I was terribly disgusted by all this, and then I don’t know how I got the idea but I went back to the SWT FAQ, and found this:
http://www.eclipse.o … g/swt/faq.php#osxvms.
Yes, that’s right, there is NO Cocoa SWT port on Tiger!
And all night long I was trying to force it into its Java guts! RTFM :{
After that I even tried to use the carbon libs on Tiger, but guess what?
https://bugs.eclipse … ow_bug.cgi?id=145890
This one particular bug, marked as ‘WONTFIX’, could be resumed by this pseudo code:
While (Tiger == Carbon && SWT_AWT.new_Shell() !available) {
DJ-NativeSwing = null;
BrowserSuite = null;
}
So now you know why you better not ask for support of the Browser Suite on Tiger.
Still, this stuff was starting to work on Leopard (a few bugs aside). With Christopher Deckers, we tracked all the problems one by one, submitted them to the SWT team, and the most crippling bugs were solved in a matter of a few weeks…
There are still a few left, and if you are reading this, please consider voting for them.
The full list (with direct links to the bug reports) is in the PDF FAQ.
Next feat was to make this work seamlessly in developer, and that my friend is a completely different story again, so I will write it in another post.
