trouble with images .jpg's in linux
Im having trouble getting Image .jpg's to show up in an executable JAR in linux. When I run the project in DrJava images are there. When I run a compiled JAR in windows it works fine, but the compiled JAR in linux has images missing. I have other images for buttons that work fine. The albumart[i] contains a folder with an image in it like
60/609830cb-a007-4c46-8039-5ad1d7a0139f
I printed the complete URL's they all look fine but none of the album images show up not even the default_m.jpg
Here is the printed URL that I get:
images/album/60/609830cb-a007-4c46-8039-5ad1d7a0139f_m.jpg
All the paths are right I placed images/album/60/etc.....etc in the compiled JAR
Anyone know what could be wrong?
Thanks,
John
Code:
String resourcePath = "images/album/"+albumart[i]+"_m.jpg";
URL flagUrl = getClass().getResource(resourcePath);
boolean exists = flagUrl != null;
System.out.println(resourcePath);
if (!exists){
resourcePath = "images/album/default_m.jpg";
}
ImageIcon icon = new ImageIcon("images/album/"+albumart[i]+"_m.jpg");