jar 文件旁边需要 db 文件夹,以便应用程序运行,我如何使用 'javapackager' 或任何其他工具捆绑文件夹

jar file needs db folder next to it, so that the application runs, how can i bundle the folder using 'javapackager' or any other tool

我开发了一个使用 derby db 的 SE 8 应用程序,当我使用 javapackager 工具打包应用程序时,使用此命令:javapackager -deploy -native -outdir packages -outfile Fun-Money -srcdir dist -srcfiles Fun-Money.jar -appclass lite.money.ui.MainUI -name "Fun Money" -title "Fun Money" -vendor "Fun Money" -Bicon=icon1.ico,打包程序将应用程序打包到文件夹中做得很好(1)和安装程序 (2)。问题是:为了让应用程序运行,我必须 copy/paste 一个名为 finance 的文件夹:这是 jar 旁边的 database在应用程序文件夹中。我压缩了那个文件夹(1)并且工作正常。现在安装程序不会将该文件夹打包到 jar 旁边,因此当用户使用 .exe 安装应用程序时,他必须手动复制粘贴 C:\Users\YOUR-NAME\AppData\Local\Fun Money\app 中的 db 文件夹,就像破解游戏一样。

我如何使用 javapackager 将该文件夹添加到应用程序文件夹中的 jar 旁边谢谢。

已解决:我用 运行 这个命令代替: javapackager -deploy -native -outdir packages -outfile Fun-Money -srcdir dist -srcfiles -appclass lite.money.ui.MainUI -name "Fun Money" -title "Fun Money" -vendor "Fun Money" -Bicon=icon1.ico 如你所见,我没有为 -srcfiles 指定任何内容,因此,javapackager 包dist 文件夹中的所有文件,这正是我想要的。

https://docs.oracle.com/javase/8/docs/technotes/tools/unix/javapackager.html 上的文档似乎不准确,因为它指出:

-srcfiles files
    List of files in the directory specified by the -srcdir option. If omitted, all files in the directory (which is a mandatory argument in this case) will be used. Files in the list must be separated by spaces.

相反,尝试为每个必须打包的文件重复 -srcfiles 选项。例如:

javapackager -deploy -native -outdir packages -outfile Fun-Money -srcdir dist -srcfiles Fun-Money.jar -srcfiles finance -appclass lite.money.ui.MainUI -name "Fun Money" -title "Fun Money" -vendor "Fun Money" -Bicon=icon1.ico