6

我正在尝试使用 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),当我手动运行脚本时,它是这样说的:

在此处输入图像描述

谁能帮助我解决这个问题?谢谢你。

4

0 回答 0