Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

GKW

[java] Loading a file from a .jar'ed application

This topic is 6419 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I need to load a .bmp file from a jared application NOT a jared applet. It works just fine until I jar it then the file loader I made no longer finds the bitmap. I searched sun.com and all I could find was a suggestion that I use getClass().getResource( "mybitmap.bmp" ) but like every one else in the forum all I get is a null URL reference. Any suggestions? I wanrned you! Didn''t I warn you?! That colored chalk was forged by Lucifer himself!
Opere Citato

Share this post


Link to post
Share on other sites
Advertisement
The problem is that the bitmap is in the jar. It kinda looks like this:

Class Lisa
toothless.crack.whore.Lisa
Hooker.bmp
toothless.crack.whore.pictures.Hooker.bmp

The picture that the class Lisa needs to load is in the jar directory toothless.crack.whore.pictures. I have tried all sorts of combinations of the package with the name of the bitmap but nothing works for the jar. Works just fine outside the jar if I just put the package name infront of the bitmap. If this was an applet I would get the codebase but I don''t know what to do for an application. I thought that having the . in the classpath was supposed to take care of this but I guess not.

I wanrned you! Didn''t I warn you?! That colored chalk was forged by Lucifer himself!

Opere Citato

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!