Darwin OpenJDK 7 Binaries - Not Working With SWT

Mike Swingler swingler at apple.com
Sun Sep 7 14:44:02 PDT 2008


On Sep 7, 2008, at 1:08 PM, Michael Franz wrote:

> This is because OpenJDK7 does not have a Cocoa-based AWT that must  
> start on thread 0 to receive events from the OS. If you simply  
> remove the -XstartOnFirstThread argument, or apply a patch to  
> OpenJDK (which I believe SoyLatte did) to ignore this "VM flag",  
> everything should start fine.
>
> I changed the startup to not pass the flag.  I was running this from  
> inside eclipse, but eclipse must somehow pass the option as it did  
> not show up in the command.
>
> I am now getting an unsatisfiedlinkerror.
>
> When I run from the command line using the Apple 1.5 JVM and then  
> using the OpenJDK.  The Apple version works. The OpenJDK produces:
> Exception in thread "main" java.lang.UnsatisfiedLinkError: no swt- 
> cocoa-3448 or swt-cocoa in swt.library.path, java.library.path or  
> the jar file
>     at org.eclipse.swt.internal.Library.loadLibrary(Library.java:233)
>     at org.eclipse.swt.internal.Library.loadLibrary(Library.java:151)
>     at org.eclipse.swt.internal.C.<clinit>(C.java:21)
>     at org.eclipse.swt.widgets.Display.createDisplay(Display.java:620)
>     at org.eclipse.swt.widgets.Display.create(Display.java:613)
>     at org.eclipse.swt.graphics.Device.<init>(Device.java:113)
>     at org.eclipse.swt.widgets.Display.<init>(Display.java:536)
>     at org.eclipse.swt.widgets.Display.<init>(Display.java:527)
>     at  
> org 
> .eclipse 
> .swt.examples.controlexample.ControlExample.main(ControlExample.java: 
> 202)
>
> The command I execute
>
>  /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/bin/ 
> java -Djava.library.path=/Users/mfranz/Documents/eclipse-3.4/ 
> workspace/org.eclipse.swt.cocoa.macosx -Dfile.encoding=MacRoman - 
> classpath /Users/mfranz/Documents/eclipse-3.4/workspace/ 
> org.eclipse.swt.examples/bin:/Users/mfranz/Documents/eclipse-3.4/ 
> workspace/org.eclipse.swt/bin:/Users/mfranz/Documents/eclipse-3.4/ 
> workspace/org.eclipse.swt/extra_jars/exceptions.jar:/Applications/ 
> eclipse-3.4/plugins/org.eclipse.swt.carbon.macosx_3.4.0.v3448f.jar  
> org.eclipse.swt.examples.controlexample.ControlExample
>
>  /Users/mfranz/developer/openjdk-bsd/openjdk7-darwin-i386-20080820/ 
> bin/java -Djava.library.path=/Users/mfranz/Documents/eclipse-3.4/ 
> workspace/org.eclipse.swt.cocoa.macosx -Dfile.encoding=MacRoman - 
> classpath /Users/mfranz/Documents/eclipse-3.4/workspace/ 
> org.eclipse.swt.examples/bin:/Users/mfranz/Documents/eclipse-3.4/ 
> workspace/org.eclipse.swt/bin:/Users/mfranz/Documents/eclipse-3.4/ 
> workspace/org.eclipse.swt/extra_jars/exceptions.jar:/Applications/ 
> eclipse-3.4/plugins/org.eclipse.swt.carbon.macosx_3.4.0.v3448f.jar  
> org.eclipse.swt.examples.controlexample.ControlExample

Sounds like OpenJDK is not recognizing .jnilib files as valid native  
libraries. Another patch to SoyLatte also allowed it to recognize  
both .dylib and .jnilib. We also made changes to Java in Mac OS X 10.5  
Leopard to recognize .dylib as well as .jnilib.

I know it's sounds super-hacky, but I bet if you renamed all  
your .jnilib's to .dylib's, it will probably work.

Best of luck,
Mike Swingler
Java Runtime Engineer
Apple Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/bsd-port-dev/attachments/20080907/e8bc03be/attachment.html 


More information about the bsd-port-dev mailing list