aspose file tools
The moose likes JNLP and Web Start and the fly likes Problem accessing an image file from a jar file Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JNLP and Web Start
Reply Bookmark "Problem accessing an image file from a jar file" Watch "Problem accessing an image file from a jar file" New topic
Author

Problem accessing an image file from a jar file

kiran manohar
Ranch Hand

Joined: Sep 28, 2003
Posts: 49
hi,
i am having a jar file called system.jar, which includes classes.jar and images.jar. the main class is in the classes.jar. when my web start is launched, it should read the main class and retrieve the image file from the images.jar. i am new to java web start. i would like to know how to solve this? any code for this. i tried the below code but it is not working. all the images are in the images.jar file
ClassLoader c1=this.getClass().getClassLoader();
URL url=c1.getResource("splashImage.jpg");
this keyword refers to the main class. any help is appreciated.
regards
Kiran
morten wilken
Greenhorn

Joined: May 25, 2002
Posts: 13
Hi,
I think your best bet is to remove the jar files from your system.jar and let webstart download all 3 jar files.
that way all 3 jar files will be in your classpath and you can access the image as you propose.
sincerely
morten wilken
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem accessing an image file from a jar file
 
Similar Threads
Reading images from a JAR file on build path
extract directory from current jar
Extracting Images from the image jar file
Set library classpath inside runnable JAR file
Showing image from a JAR on a JSP page