This week's book giveaway is in the Python forum.
We're giving away four copies of Python Continuous Integration and Delivery and have Moritz Lenz on-line!
See this thread for details.
Win a copy of Python Continuous Integration and Delivery this week in the Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Devaka Cooray
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Tim Holloway
  • Claude Moore
  • Stephan van Hulst
Bartenders:
  • Winston Gutkowski
  • Carey Brown
  • Frits Walraven

Problem accessing an image file from a jar file  RSS feed

 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!