usertest usertest - 1 month ago 4x
Java Question

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

I developed an SE 8 application that uses derby db, when i package the application using javapackager tool, using this command:

javapackager -deploy -native -outdir packages -outfile Fun-Money -srcdir dist -srcfiles Fun-Money.jar -appclass -name "Fun Money" -title "Fun Money" -vendor "Fun Money" -Bicon=icon1.ico
, the packager does a pretty good job packaging the application in folder(1), and installer(2). the problem is: so that the application runs I have to copy/paste a folder called finance: which is the database next to the jar in tha app folder. I zip that folder(1) and works fine. now the installer does not package that folder next to the jar, so when the user install the application using .exe, he MUST manually copy paste the db folder in
C:\Users\YOUR-NAME\AppData\Local\Fun Money\app
, you know like cracking a game .

How Can I use a javapackager to add that folder next to the jar in the app folder thanks.


Solved: I run this command instead: javapackager -deploy -native -outdir packages -outfile Fun-Money -srcdir dist -srcfiles -appclass -name "Fun Money" -title "Fun Money" -vendor "Fun Money" -Bicon=icon1.ico as you see I did not specify anything for -srcfiles, as a result, javapackager bundles ALL files in dist folder which is exactly what i want.