[e-lang] SWT library versions

Kevin Reid kpreid at mac.com
Thu Jul 31 14:15:59 CDT 2008


>> I seem to recall you knew a swt library upgrade was needed -- ?
>
> I don't recall that but I'm not surprised. Do you know what version  
> we need? Should we just grab the latest?

I don't have any information on that. What I did dig up since then is  
that there is a bug in the -XstartOnFirstThread mode, which is needed  
for Mac SWT:

http://lists.apple.com/archives/java-dev//2008/Feb/msg00179.html

I added this fix to the beginning of Rune#main and it stopped exiting  
silently -- instead it gets to the point of having a menu bar, but  
hangs instead of responding to events.


I tried downloading newer SWT versions (3.3.2 and 3.4), but the  
behavior did not change.

(By the way, the swt.jar is architecture-independent, so we shouldn't  
have two copies in mac/ppc/ and mac/x86/. If I upgrade it I'll put it  
in bin/mac/ and symlink from the arch directories -- or should I  
revert the change (which I didn't write) that looked for swt in arch- 
specific dirs?)

Index: src/jsrc/org/erights/e/elang/interp/Rune.java
===================================================================
--- src/jsrc/org/erights/e/elang/interp/Rune.java	(revision 505)
+++ src/jsrc/org/erights/e/elang/interp/Rune.java	(working copy)
@@ -312,6 +312,14 @@
       *
       */
      static public void main(String[] argArray) {
+
+        // workaround for bug in Mac OS X Leopard Java - 
XstartOnFirstThread (needed for swt); from http://lists.apple.com/archives/java-dev//2008/Feb/msg00179.html
+        {
+            final Thread t = Thread.currentThread();
+            if (t.getContextClassLoader() == null) {
+                 
t.setContextClassLoader(ClassLoader.getSystemClassLoader());
+            }
+        }

          final TextWriter errs =
            new TextWriter(PrintStreamWriter.stderr(), true);


-- 
Kevin Reid                            <http://homepage.mac.com/kpreid/>




More information about the e-lang mailing list