将文件扩展名与 JavaFX Mac OS X 应用程序相关联

Associate file extension with JavaFX Mac OS X application

我已经为 Mac OS X 捆绑了一个 JavaFX 应用程序。我现在正在尝试将文件扩展名与 sample.app 应用程序相关联。 This 是我能找到的关于此事的最后一个问题,但我无法让它发挥作用。有没有我遗漏的新东西?

为 OS X 本机打包应用程序指定文件关联的能力是 Java 8u40 中添加到 Java 客户端打包程序的新功能。

来自Oracle Java 8u40 client application deployment documentation

7.3.7 Associating Files with a Self-Contained Application

The installer for a self-contained application can be set up to register file associations for the application. The element is used in an Ant task to identify the files that can be handled by the application. File associations are based on either the file extension or MIME type.

The following example associates the application with files that have the MIME type application/x-vnd.MyAppFile.

<fx:info title="Association example">   
    <fx:association
        mimetype="application/x-vnd.MyAppFile" description="Sample Test Files">   
    </fx:association> 
</fx:info>

为 Java 8u40 实施的相关问题: