Summary: | Freeze on loadLibrary of AWT in Eclipse RCP app inside GLProfile.initSingleton() on Mac OS X | ||
---|---|---|---|
Product: | [JogAmp] Jogl | Reporter: | Wade Walker <wwalker3> |
Component: | macosx | Assignee: | Wade Walker <wwalker3> |
Status: | VERIFIED INVALID | ||
Severity: | normal | ||
Priority: | --- | ||
Version: | 2 | ||
Hardware: | pc_x86_64 | ||
OS: | macosx | ||
Type: | --- | SCM Refs: | |
Workaround: | --- |
Description
Wade Walker
2011-03-24 02:57:29 CET
The bug 486 shows up after I bypass this one. Not sure if the lack of AWT load causes bug 486 (it also happens if I omit GLProfile.initSingleton() instead of using -Djava.awt.headless). This bug has been seen in the wild at http://wadeawalker.wordpress.com/2010/10/09/tutorial-a-cross-platform-workbench-program-using-java-opengl-and-eclipse/#comment-52. He mentions the same behavior I've seen, where Eclipse sticks at the flash screen. The problem seems to be when loading the AWT library -- it freezes inside the loadLibrary() call. Setting -Djava.awt.headless=true fixes this problem, and also fixes a separate problem where standalone (non-RCP) SWT apps freeze when you quit (on Mac OS X). Apparently loading libawt.jnilib if you're using SWT on the Mac is just a bad idea. The thread at http://lists.apple.com/archives/Java-dev/2008/Dec/msg00249.html says that Apple's JDK checks for -XstartOnFirstThread=true and if so doesn't load AWT. Perhaps we should check for this in NativeWindowFactory.initSingleton()? Or maybe run all SWT apps with -Djava.awt.headless=true on the Mac? Apparently the right answer is to set -Djava.awt.headless=true on Mac OS X RCP projects. The RuntimeMXBean can't see the -XstartOnFirstThread argument to the JVM, so we can't piggyback on that. And there's no way for GLProfile.initSingleton() to know that a program is going to use SWT later, so I don't think we can change JOGL to fix this. |