Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Clearly, your main method is not being executed on the main thread. You can see in the stack trace that the launcher is actually started in another thread, and then the <code>Launcher</code> only indirectly calls <code>main</code>. This is unfortunately just the diagnostic, I am not sure about the solution. I have done a similar thing (SWT app through Java Web Start), but I can't remember how we solved this, if at all.</p> <p>After checking the <a href="http://javasourcecode.org/html/open-source/jdk/jdk-6u23/com/sun/javaws/Launcher.java.html" rel="nofollow">com.sun.javaws.Launcher</a> source code, it is quite unclear how this could be made to work. The <code>Launcher.launch</code> method starts a new thread within which your <code>main</code> method is executed. You can follow the code to recreate the exact stacktrace you are getting.</p> <p>The <a href="http://javasourcecode.org/html/open-source/jdk/jdk-6u23/com/sun/javaws/Main.java.html#line.67" rel="nofollow">main entry point</a> of Java Web Start shows that the main thread dies soon after starting.</p> <h2>Update</h2> <p>I dug something out: in <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=288436" rel="nofollow">this Eclipse bug report</a> it is suggested that the problem could be related to this:</p> <pre><code>&lt;resources&gt; &lt;j2se version="1.4+" /&gt; &lt;jar href="client.jar" /&gt; &lt;/resources&gt; </code></pre> <p>The parser takes the j2se spec from here and ignores the later, more specific ones. Try removing the <code>&lt;j2se...</code> line.</p> <h2>Update 2</h2> <p>Now I dug this up from <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=303869" rel="nofollow">here</a>:</p> <pre><code>com.apple.concurrent.Dispatch.getInstance().getNonBlockingMainQueueExecutor().execute( new Runnable() { public void run() { final Display display = Display.getDefault(); while (!display.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } }); </code></pre> <p>This actually sounds like something workable. It does exactly what I described in my comment below: patches into the main thread through a mechanism specifically put in place for this purpose. Try to adapt this to your need. You may not even need -XstartOnFirstThread with this.</p> <h2>Update 3</h2> <p>I finally found my old SWT-JWS project. It's got this in it:</p> <pre><code>&lt;resources os="Mac OS X" arch="x86_64"&gt; &lt;j2se version="1.6+" java-vm-args="-XstartOnFirstThread"/&gt; &lt;jar href="swt-cocoa-macosx-x86-64-3.6.2.jar" /&gt; &lt;/resources&gt; </code></pre> <p>and it works. It has no default <code>j2se</code> element, this element appears <strong>only</strong> in the OSX-specific entry.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload