javapackager无法在macOS上生成dmg

jljoyd4f  于 2023-01-29  发布在  Java
关注(0)|答案(1)|浏览(147)

我正在尝试使用javapackager从jar生成dmg。
下面是我输入终端的内容:

cd "/Users/name/Documents/JarToApplication"
jdk=$(/usr/libexec/java_home -v 1.8)
$jdk/bin/javapackager -deploy -native dmg -BappVersion=8 -name DMSLauncher -srcdir . -srcfiles DMSLauncher.jar -appclass com.blockhead7360.dms.launcher.DMSLauncher -Bicon=package/macosx/DMSLauncher.icns -outdir deploy -outfile DMSLauncher -v

一直到这里:

Running [osascript, /var/folders/z5/n802xjnx49l4535kq63992280000gn/T/fxbundler8419176091447096668/macosx/DMSLauncher-dmg-setup.scpt]
/var/folders/z5/n802xjnx49l4535kq63992280000gn/T/fxbundler8419176091447096668/macosx/DMSLauncher-dmg-setup.scpt:635:742: execution error: Finder got an error: The operation can’t be completed because there is already an item with that name. (-48)
java.io.IOException: Exec failed with code 1 command [[osascript, /var/folders/z5/n802xjnx49l4535kq63992280000gn/T/fxbundler8419176091447096668/macosx/DMSLauncher-dmg-setup.scpt] in unspecified directory
    at com.oracle.tools.packager.IOUtils.exec(IOUtils.java:165)
    at com.oracle.tools.packager.IOUtils.exec(IOUtils.java:138)
    at com.oracle.tools.packager.IOUtils.exec(IOUtils.java:132)
    at com.oracle.tools.packager.mac.MacDmgBundler.buildDMG(MacDmgBundler.java:376)
    at com.oracle.tools.packager.mac.MacDmgBundler.bundle(MacDmgBundler.java:92)
    at com.oracle.tools.packager.mac.MacDmgBundler.execute(MacDmgBundler.java:556)
    at com.sun.javafx.tools.packager.PackagerLib.generateNativeBundles(PackagerLib.java:352)
    at com.sun.javafx.tools.packager.PackagerLib.generateDeploymentPackages(PackagerLib.java:319)
    at com.sun.javafx.tools.packager.Main.main(Main.java:476)
  Config files are saved to /var/folders/z5/n802xjnx49l4535kq63992280000gn/T/fxbundler8419176091447096668/macosx. Use them to customize package.
Exception in thread "main" com.sun.javafx.tools.packager.PackagerException: Error: Bundler "DMG Installer" (dmg) failed to produce a bundle.
    at com.sun.javafx.tools.packager.PackagerLib.generateNativeBundles(PackagerLib.java:354)
    at com.sun.javafx.tools.packager.PackagerLib.generateDeploymentPackages(PackagerLib.java:319)
    at com.sun.javafx.tools.packager.Main.main(Main.java:476)
logout
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.

我去了文件,它说它有一个问题(DMSLauncher-dmg-setup.scpt),当我手动运行脚本,这是它说:

有人能帮我解决这个问题吗?谢谢。

6jygbczu

6jygbczu1#

如果有人仍然看到这个问题,我所做的解决它是检查/Volumes文件夹并弹出卷。这里的卷将是'DMSLauncher'。

相关问题