(Two months later) Please fix bug https://bugs.openjdk.java.net/browse/JDK-8179033
See patch below (or previous letter http://mail.openjdk.java.net/pipermail/openjfx-dev/2017-October/020878.html) See example on GitHub to check https://github.com/dbelob/multiplatform-distribution How to build for Windows and macOS: mvn clean package -P native-deploy (there is no error on Linux) With best regards, Dmitry Beloborodov On Mon, Oct 9, 2017 at 6:52 PM, Dmitry Beloborodov <[email protected] > wrote: > There is JDK-8179033 > https://bugs.openjdk.java.net/browse/JDK-8179033 > ("javapackager fails to create Mac Application Bundle") > > Error is reproduced on macOS and Windows > (there is no error on Linux) > > Cause is the absence of a destination resource subdirectory. > > I suppose that to fix the error it is enough to create subdirectories > before copying of destination resources > (see correct methods > com.oracle.tools.packager.windows.WinAppBundler::copyApplication in Java 8 > com.oracle.tools.packager.mac.MacAppBundler::copyClassPathEntries in Java > 8 > com.oracle.tools.packager.linux.LinuxAppBundler::copyApplication in Java 8 > or > jdk.packager.builders.linux.LinuxAppImageBuilder::copyApplication in Java > 9 > ) > > To fix it (in Java 9) you need to > 1. Change in > jdk.packager.builders.windows.WindowsAppImageBuilder::copyApplication > method > from > for (String fname : appResources.getIncludedFiles()) { > Files.copy(new File(srcdir, fname).toPath(), new > File(appDir.toFile(), fname).toPath()); > } > to > for (String fname : appResources.getIncludedFiles()) { > File destFile = new File(appDir.toFile(), fname); > > destFile.getParentFile().mkdirs(); > Files.copy(new File(srcdir, fname).toPath(), destFile.toPath()); > } > > 2. Change in jdk.packager.builders.mac.MacAppImageBuilder::copyApplication > method > from > for (String fname : classPath.getIncludedFiles()) { > // use new File since fname can have file separators > Files.copy(new File(srcdir, fname).toPath(), new > File(javaDirectory.toFile(), fname).toPath()); > } > to > for (String fname : classPath.getIncludedFiles()) { > // use new File since fname can have file separators > File destFile = new File(javaDirectory.toFile(), fname); > > destFile.getParentFile().mkdirs(); > Files.copy(new File(srcdir, fname).toPath(), destFile.toPath()); > } > > Please fix error. Many thanks! > > With best regards, > Dmitry Beloborodov >
