On Mac OS X opening my document by double clicking at the document fails if my application is not already running
<p>On Mac OS X opening my document by double clicking at the document fails if my application is not already running</p>

<p>When launching my drawing application by double clicking at a document Finder shows a dialog which says: </p>

<blockquote>
  <p>The document "test.jdwg" could not be opened. Application "jDraft" cannot open files in the "jDraft Document" format.</p>
</blockquote>

<p><a href="https://i.stack.imgur.com/K0knS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/K0knS.png" alt="enter image description here"></a></p>

<p>This message dialog appears before my application has time to even put up its splash screen, however the application is launched in the background (I see the splash screen) and when I double click again at the document my application correctly opens it.</p>

<p>As a background this application has been working (in this respect) for years. This problem appeared now when I'm trying to use the <a href="http://www.jwrapper.com" rel="nofollow noreferrer">JWrapper</a> to package my application. </p>

<p>Following is <code>Info.plist</code> for my application.</p>

<p>I suspect this maybe related to the way JWrapper lauches or forks the JVM to run the application ... hard to tell because JWrapper is closed source and thus pretty much beyond debuggin.</p>

<p>Has anyone managed to make file associations work with JWrapper on Mac OS X?</p>

<pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
&lt;plist version="1.0"&gt;
&lt;dict&gt;
    &lt;key&gt;CFBundleName&lt;/key&gt;
    &lt;string&gt;jDraft&lt;/string&gt;
    &lt;key&gt;CFBundleIdentifier&lt;/key&gt;
    &lt;string&gt;jwrapper.osx.jDraft&lt;/string&gt;
    &lt;key&gt;CFBundleVersion&lt;/key&gt;
    &lt;string&gt;43568712&lt;/string&gt;
    &lt;key&gt;CFBundleAllowMixedLocalizations&lt;/key&gt;
    &lt;string&gt;true&lt;/string&gt;
    &lt;key&gt;CFBundleExecutable&lt;/key&gt;
    &lt;string&gt;osxwrapper&lt;/string&gt;
    &lt;key&gt;CFBundleDevelopmentRegion&lt;/key&gt;
    &lt;string&gt;English&lt;/string&gt;
    &lt;key&gt;CFBundlePackageType&lt;/key&gt;
    &lt;string&gt;APPL&lt;/string&gt;
    &lt;key&gt;LSUIElement&lt;/key&gt;
    &lt;true/&gt;
    &lt;key&gt;CFBundleSignature&lt;/key&gt;
    &lt;string&gt;????&lt;/string&gt;
    &lt;key&gt;CFBundleInfoDictionaryVersion&lt;/key&gt;
    &lt;string&gt;6.0&lt;/string&gt;
    &lt;key&gt;CFBundleIconFile&lt;/key&gt;
    &lt;string&gt;AppLogo.icns&lt;/string&gt;
    &lt;key&gt;NSHighResolutionCapable&lt;/key&gt;
    &lt;true/&gt;
    &lt;key&gt;NSAppTransportSecurity&lt;/key&gt;
    &lt;dict&gt;
        &lt;key&gt;NSAllowsArbitraryLoads&lt;/key&gt;
        &lt;true/&gt;
    &lt;/dict&gt;
    &lt;key&gt;CFBundleDocumentTypes&lt;/key&gt;
    &lt;array&gt;
        &lt;dict&gt;
            &lt;key&gt;CFBundleTypeName&lt;/key&gt;
            &lt;string&gt;jDraft Drawing 2&lt;/string&gt;
            &lt;key&gt;LSHandlerRank&lt;/key&gt;
            &lt;string&gt;Default&lt;/string&gt;
            &lt;key&gt;CFBundleTypeRole&lt;/key&gt;
            &lt;string&gt;Editor&lt;/string&gt;
            &lt;key&gt;CFBundleTypeIconFile&lt;/key&gt;
            &lt;string&gt;jDraft-doc-jdwg.icns&lt;/string&gt;
            &lt;key&gt;CFBundleTypeExtensions&lt;/key&gt;
            &lt;array&gt;
                &lt;string&gt;jdwg&lt;/string&gt;
            &lt;/array&gt;
            &lt;key&gt;CFBundleTypeOSTypes&lt;/key&gt;
            &lt;array&gt;
                &lt;string&gt;jdwg&lt;/string&gt;
            &lt;/array&gt;
        &lt;/dict&gt;
    &lt;/array&gt;
&lt;/dict&gt;
&lt;/plist&gt;
</code></pre>