I have a java application. And It loads images from a directory
"C:\\Users\\elliotbewey\\Desktop\\IMGS\\BOB.png"
And it loads fine the image displays. Now If I was to compile it into a runnable jar and send it to my friend. it would not work. What would I need to do get a installer? And get system information? Help!
//note I do understand that its going to my friends computer so \\users\\elliotbewey would not work because its his computer thats what I need help with
You need to package your images inside your jar, then reference them as resources. Doing a google search for "java package images inside jar as resource" will give you a ton of results and tutorials.
This approach will work from an IDE on your computer or from a packaged jar on your friend's computer. Using an installer is definitely overkill for this goal.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments