在 MacOS 上,我可以为我的 Java 应用程序添加一个默认设置作为我的 Info.plist 文件的一部分吗

On MacOS Can I add a default setting as part of my Info.plist file for my Java application

由于MacOS Big Sur中的bug,我需要运行以下命令

defaults write com.jthink.songkong "AppleWindowTabbingMode" manual

对于我的 Java 应用程序,捆绑版本 java

有什么方法可以将它添加到我的 Info.plist 文件中,以便它已经在新安装时自动设置,我也可以使用 Runtime class 到 运行 来自 Java 的命令,但是如果我可以将它配置为 Info.plist 文件的一部分会更整洁,但是我不太了解 macOS,不知道这是否有意义。 我设法在构建期间添加了它,所以我的 Info.plist 文件包含

<key>AppleWindowTabbingMode</key>
<string>manual</string> 

但是,一直没有效果。

我不清楚是我做错了什么,还是根本不可能。

截至几分钟前 appbundler will set the default value for the AppleWindowTabbingMode property to "manual" upon launch. If you use it as your launcher it should fix this behaviour. Or you can check the native code in the commit 如果您愿意,可以在您自己的启动器中使用它。