I wonder if there is a way to extract a resource file packaged in an executable jar file and save it to a local drive, so when a user downloads my jar file and double clicks on it, it will first save one file from the resource to his C: drive, then run my program.
Share
Just use ClassLoader.getResourceAsStream() to get an
InputStreamto the contents of that resource, and write it to (say) the temp directory. In yourmain()method just do this before you do execute the main part of your program.