Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 在Mac OS X上,如果应用程序尚未运行,则双击文档打开文档失败_Java_Macos_Jwrapper - Fatal编程技术网

Java 在Mac OS X上,如果应用程序尚未运行,则双击文档打开文档失败

Java 在Mac OS X上,如果应用程序尚未运行,则双击文档打开文档失败,java,macos,jwrapper,Java,Macos,Jwrapper,在Mac OS X上,如果应用程序尚未运行,则双击文档打开文档失败 双击document Finder启动“我的绘图”应用程序时,会显示一个对话框,其中显示: 无法打开文档“test.jdwg”。应用程序“jDraft”无法打开“jDraft文档”格式的文件 此消息对话框出现在我的应用程序甚至没有时间设置启动屏幕之前,但是应用程序是在后台启动的(我看到启动屏幕),当我再次双击文档时,我的应用程序将正确打开它 作为背景,此应用程序(在这方面)已运行多年。现在,当我尝试使用打包应用程序时,出现了此

在Mac OS X上,如果应用程序尚未运行,则双击文档打开文档失败

双击document Finder启动“我的绘图”应用程序时,会显示一个对话框,其中显示:

无法打开文档“test.jdwg”。应用程序“jDraft”无法打开“jDraft文档”格式的文件

此消息对话框出现在我的应用程序甚至没有时间设置启动屏幕之前,但是应用程序是在后台启动的(我看到启动屏幕),当我再次双击文档时,我的应用程序将正确打开它

作为背景,此应用程序(在这方面)已运行多年。现在,当我尝试使用打包应用程序时,出现了此问题

下面是我的应用程序的
Info.plist

我怀疑这可能与JWrapper启动或分叉JVM以运行应用程序的方式有关。。。很难说,因为JWrapper是封闭源代码的,因此几乎超出了debuggin

有没有人能在Mac OS X上使用JWrapper实现文件关联

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

CFBundleName
jDraft
CbundleIdentifier
jwrapper.osx.jDraft
循环流化床锅炉
43568712
CbundleAllowMixedLocalizations
真的
Cbundlexecutable
osxwrapper
CfBundledDevelopmentRegion
英语
CbundlePackageType
应用
LSUIElement
CFBundleSignature
????
CbundleInfo字典版本
6
循环流化床锅炉
AppLogo.icns
NShighResolutionable
NSAppTransportSecurity
NSAllowsArbitraryLoads
CbundleDocumentTypes
CbundleTypeName
图纸2
伊斯汉德兰克
违约
CbundleTypeRole
编辑
CbundleTypeConfigile
jDraft-doc-jdwg.icns
CbundleTypeExtensions
jdwg
Cbundletypeostypes
jdwg

我想我可以确认这是一个JWrapper问题,目前无法令人满意地解决

我将JWrapper生成的包中的所有内容复制到我的原始应用包中,该包没有这个问题(幸运的是,没有冲突的文件名!)

我的应用程序仍然运行良好

然后我在“Info.plist”中更改了这一属性

<key>CFBundleExecutable</key>
<string>JavaApplicationStub</string>
CbundleExecutable
JavaApplicationStub

CbundleExecutable
osxwrapper
问题又出现了,这意味着当应用程序启动时,我会看到“无法打开”对话框

因此,我的结论是,这并不是Mac OS/Finder在做这件事并建立对话框,而是JWrapper
osxwrapper
建立了对话框,并未能将文档传递给我的Java代码或吞下了“打开文档事件”

我还尝试了
osxlauncher
可执行文件,JWrapper将其放入
.app/Contents/MacOS
文件夹中,结果相同

也许有一种方法可以告诉
osxwrapper
,我的应用程序可以打开这些文档,但我还没有找到任何文档。或者这可能是一个不受支持的特性,这在其他优秀产品中是一个严重的遗漏


无论哪种方式,从JWrapper的人那里得到一个明确的答案都是很好的,这样我就不用再浪费时间了。

我正在使用InfiniteKind AppBundler fork,并通过Open像一个魔咒一样启动works。所以我想你是对的,可能是JWrapper。因为它是封闭源代码,没有公共bug数据库,我建议联系他们的支持人员。考虑到他们每个座位的价格,他们希望有义务帮助你。谢谢你的信息。我已经就这个问题和另一个问题联系了他们,但从未收到任何反馈,不是直接的,不是在这里。他们说stackoverflow是他们支持人们的地方,但到目前为止,我还没有看到他们有多少支持。皮蒂:真的,因为产品很好,很精致,最终用户体验(这就是我所关心的)非常好。我猜付费客户会得到更好的服务,但我希望他们会有一些回应,因为SO中没有那么多问题压倒他们。如果我能停止在JWrapper上浪费时间就好了。
<key>CFBundleExecutable</key>
<string>osxwrapper</string>