Click to See Complete Forum and Search --> : Problem with resource files after packing jar file


knobody
September 25th, 2009, 01:08 PM
Hey, I have a GUI I made that uses buttons that execute a couple of scripts and a C++ executable. I did the project in Netbeans, and when I run the program in the IDE, my files work perfectly as long as they are in my project folder. When I pack my jar file, however, those files don't work. I have seen examples that dealt with this type of problem with image files, but so far nothing that fits my problem. Is there a workaround that would allow me to use my scripts and executable after packing a jar file, or will I need to just run the GUI from Netbeans?

Thanks for reading.

jcaccia
September 25th, 2009, 03:14 PM
Keep your scripts and executable out of the jar, where the OS can see them (when you run them from within your Java class you are actually creating a child process for the OS to execute the script/program).

knobody
September 25th, 2009, 04:59 PM
Thanks for your reply. If I'm reading you right, the jar executable will recognize the files if they are outside of the jar but within the same executable as the jar. I'll try it! Thanks!