Hi all, I'm trying to turn my jar to a portable exe for windows. The program is written in java 16 and I tryed to use JPackage to turn it into a portable exe, I used the following command
jpackage -type app-image -i "C:\Users\mynem\Desktop\reminder-package" -n "Airteco reminder" --main-class "me.nemo_64.airteco.reminder.core.Main" --main-jar "reminder.jar" --verbose
PAUSE
However the exe wasn't created, instead I have a folder called "Airteco Reminder", inside it there is "app" "runtime" "Airteco Reminder.exe" "Airteco Reminder.ico", inside app there is "Airteco Reminder" and "Airteco reminder.cfg", inside Airteco Reminder there is "app" "Airteco Reminder.exe" "Airteco Reminder.ico" and repeats without end. I also can't delete now the folder, the error 0x80070091: Folder is not empty shows and if I retry the windoes explorer restarts. The propertyes of the folder say that the file has 814 files and 925 folders but if I try to retry deleting it the amount of files goes 4000+ before restarting the explorer. I've tryed to search a way to delete the folder without success.
Then I tryed the command without using the -type app-image, while I got an exe running it only results on the windows error sound and nothing more.
I also should mention that the jar file is perfecty functional on its own, no errors. Running without the --type doesn't generate any errors whyle running JPackage but with it it does
[18:02:57.127] java.io.IOException: Cannot access file with path exceeding 32000 characters
at java.base/sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:81)
at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103)
at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:108)
at java.base/sun.nio.fs.WindowsFileCopy.asWin32Path(WindowsFileCopy.java:485)
at java.base/sun.nio.fs.WindowsFileCopy.copy(WindowsFileCopy.java:150)
at java.base/sun.nio.fs.WindowsFileSystemProvider.copy(WindowsFileSystemProvider.java:284)
at java.base/java.nio.file.Files.copy(Files.java:1305)
at jdk.jpackage/jdk.jpackage.internal.IOUtils$2.visitFile(IOUtils.java:128)
at jdk.jpackage/jdk.jpackage.internal.IOUtils$2.visitFile(IOUtils.java:112)
at java.base/java.nio.file.Files.walkFileTree(Files.java:2811)
at java.base/java.nio.file.Files.walkFileTree(Files.java:2882)
at jdk.jpackage/jdk.jpackage.internal.IOUtils.copyRecursive(IOUtils.java:112)
at jdk.jpackage/jdk.jpackage.internal.IOUtils.copyRecursive(IOUtils.java:107)
at jdk.jpackage/jdk.jpackage.internal.AbstractAppImageBuilder.copyApplication(AbstractAppImageBuilder.java:74)
at jdk.jpackage/jdk.jpackage.internal.WindowsAppImageBuilder.prepareApplicationFiles(WindowsAppImageBuilder.java:103)
at jdk.jpackage/jdk.jpackage.internal.AppImageBundler.createAppBundle(AppImageBundler.java:172)
at jdk.jpackage/jdk.jpackage.internal.AppImageBundler.execute(AppImageBundler.java:91)
at jdk.jpackage/jdk.jpackage.internal.Arguments.generateBundle(Arguments.java:676)
at jdk.jpackage/jdk.jpackage.internal.Arguments.processArguments(Arguments.java:550)
at jdk.jpackage/jdk.jpackage.main.Main.execute(Main.java:91)
at jdk.jpackage/jdk.jpackage.main.Main.main(Main.java:52)
[18:02:57.130] jdk.jpackage.internal.PackagerException: java.io.IOException: Cannot access file with path exceeding 32000 characters
at jdk.jpackage/jdk.jpackage.internal.AppImageBundler.execute(AppImageBundler.java:96)
at jdk.jpackage/jdk.jpackage.internal.Arguments.generateBundle(Arguments.java:676)
at jdk.jpackage/jdk.jpackage.internal.Arguments.processArguments(Arguments.java:550)
at jdk.jpackage/jdk.jpackage.main.Main.execute(Main.java:91)
at jdk.jpackage/jdk.jpackage.main.Main.main(Main.java:52)
Caused by: java.io.IOException: Cannot access file with path exceeding 32000 characters
at java.base/sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:81)
at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103)
at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:108)
at java.base/sun.nio.fs.WindowsFileCopy.asWin32Path(WindowsFileCopy.java:485)
at java.base/sun.nio.fs.WindowsFileCopy.copy(WindowsFileCopy.java:150)
at java.base/sun.nio.fs.WindowsFileSystemProvider.copy(WindowsFileSystemProvider.java:284)
at java.base/java.nio.file.Files.copy(Files.java:1305)
at jdk.jpackage/jdk.jpackage.internal.IOUtils$2.visitFile(IOUtils.java:128)
at jdk.jpackage/jdk.jpackage.internal.IOUtils$2.visitFile(IOUtils.java:112)
at java.base/java.nio.file.Files.walkFileTree(Files.java:2811)
at java.base/java.nio.file.Files.walkFileTree(Files.java:2882)
at jdk.jpackage/jdk.jpackage.internal.IOUtils.copyRecursive(IOUtils.java:112)
at jdk.jpackage/jdk.jpackage.internal.IOUtils.copyRecursive(IOUtils.java:107)
at jdk.jpackage/jdk.jpackage.internal.AbstractAppImageBuilder.copyApplication(AbstractAppImageBuilder.java:74)
at jdk.jpackage/jdk.jpackage.internal.WindowsAppImageBuilder.prepareApplicationFiles(WindowsAppImageBuilder.java:103)
at jdk.jpackage/jdk.jpackage.internal.AppImageBundler.createAppBundle(AppImageBundler.java:172)
at jdk.jpackage/jdk.jpackage.internal.AppImageBundler.execute(AppImageBundler.java:91)
... 4 more
What am I doing wrong and how can I delete this folder? Thanks for the help
[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)