Reputation: 13
I'm trying to export my Java game as a Runnable
Jar which works, but when I open it up I get an error that my files aren't present.
Picture of error:
Picture of res folder in eclipse:
The game runs perfectly fine in Eclipse.
I have added the res folder as a source folder.
Thank you!
Upvotes: 1
Views: 132
Reputation: 20023
The contents of a jar file are not java.io.File
s. Understand that you don't actually care about the files, you want their contents, so start using getResourceAsStream()--it works for both cases pretty transparently.
Upvotes: 1