• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Read file from runme.jar

 
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi folks,
I making some tests in my assignment and when I started the client in another computer and I found some problems in time to read my suncertify.properties and other files from runme.jar.
I'm doing so:
URL url = getClass().getClassLoader().getResource("suncertify.properties");
URI uri = new URI(url.toString());

Properties props = new Properties();
props.load(new FileInputStream(new File(uri)));
String className = (String)props.get("LOOK_AND_FEEL");
if(className != null){
UIManager.setLookAndFeel(className);
}

I think when I use "props.load(new FileInputStream(new File(uri)));" the system tries to find the file in the system files and not in the runme.jar.
What I have to do?
Thanks,
Wilder
 
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I cant remember the exact words given in the instruction. But the idea is, the suncertify.propeties file should be in your currentworking directory regardless of where your runme.jar file is.
Arun
 
this llama doesn't want your drama, he just wants this tiny ad for his mama
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic