I want to deploy (create myapp.jar
and from this .jar create myapp.exe
file for installer) a java swing application.
I have a some packages:
resource package (net.myapp.ui.resource)
inside i have .png, .wav, ... files)output report package (net.myapp.ui.jasper.output.report)
inside i have exported files (report1.pdf, report2.pdf, etc.)config package (ne.myapp.ui.config)
which contain config.properties file which can by updated after app have been installed because this file contain**persistence.xml**
properties to create an EntityManagerFactory dynamically depending on the database server info.
From NetBeans IDE i can run app and it's work without problem; but when I build app, a .jar file is created: in dist directory i only have :
--> myapp.jar
--> lib folder
So i'm unable to access config.properties to setup database server IP and other parameters to be used in persistence.xml at runtime.
The question is : How do not put resources, output report, config ... in the classes package tree, but outside and access every resource from code using getResources() or getResourceAsStream() or ClassLoader ?
I want this strucure (after netbeans project build):
dist (folder)
/myApp.jar
/lib/lots-of-jar’s
/config/config.properties
/resources/my_cat.jpg
/output/report/report1.pdf, ...
....
Thank you for your help.