Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

.JAR file not starting (FileNotFound Exception)

843789Apr 9 2010 — edited Jul 11 2010
Hi

I'm trying to find out why my jar file won't work. My program compiles and works ok when launched from BlueJ. It is a game and it makes use a several images. If I compress it to create a jar (including all the used libraries, the source code and selecting the class with the main method) and then i click on the file nothing happens. If I execute it from the command line a get a long series of strings going:

java.io.FileNotFoundException: Cannot read image file "images/walk-left.gif"

And there's basically one of these lines for pretty much every image used. This screen closes up after like 1 second.

My pc runs jar files ok as I tried others..and all the images are inside the jar file in the same directory where they should be...I'm really confused.

Any ideas what this could mean? Is there a special step I've missed when it comes to creating .jar files of codes that access files?

Thank you very much for your help
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 8 2010
Added on Apr 9 2010
7 comments
293 views