Karten
Karten

Reputation: 13

java - Eclipse won't export with declared source folder

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 error

Picture of res folder in eclipse:

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

Answers (1)

nitind
nitind

Reputation: 20023

The contents of a jar file are not java.io.Files. 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

Related Questions