i'm developing a java application using Netbeans 8.0.2 and I need to create the .app file for Mac OS X. The application needs two folder ("logs" and "res" to run correctly, the former contains txt log files, the ladder containing sqlite db and images).
Netbeans provides the functionality "package as -> Image Only"
1) Unfortunately this doesn't work: double click on .app files open and immediately close application without any error messages. in fact, folders "logs" and "res" are missing in the .app file
2) As expected, running the jar will raise an io exception:
DaveMac:Java Dave$ java -jar AnamnesiPazienti/dist/bundles/Anamnesi\ Pazienti.app/Contents/Java/AnamnesiPazienti.jar
[EL Warning]: 2015-05-13 22:17:10.086--ServerSession(1569933050)--Local Exception Stack:
Exception [EclipseLink-7274] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.ValidationException
Exception Description: An Exception was thrown while trying to create logging file [logs/persistence.txt]:[java.io.FileNotFoundException: logs/persistence.txt (No such file or directory)].
3) Manually inserting logs and res folder makes application runnable (but only using the jar inside .app image).
4) Unfortunately, this doesn't work running application from .app file. It will have same behavior like 1): application start and close in a while without any message error.
5) Running (double click) script file Anamnesi\ Pazienti.app/Contents/MacOS/Anamnesi\ Pazienti causes same error in 2) (like logs and res are missing!!!!!).
DaveMac:Java Dave$ ./AnamnesiPazienti/dist/bundles/Anamnesi\ Pazienti.app/Contents/MacOS/Anamnesi\ Pazienti
[EL Warning]: 2015-05-13 22:27:40.434--ServerSession(368936209)--Local Exception Stack:
Exception [EclipseLink-7274] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.ValidationException
Exception Description: An Exception was thrown while trying to create logging file [logs/persistence.txt]:[java.io.FileNotFoundException: logs/persistence.txt (No such file or directory)].
Internal Exception: java.io.FileNotFoundException: logs/persistence.txt (No such file or directory)
QUESTION) How should I declare the presence of logs and res folder for .app file? I suppose there are some configuration to provide in info.plist (last image), but I'm stuck without any idea!