• 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

How to set the location of the property file in the class path

 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
i need to read a property file.If i give the full path say "c:\example\test.properties" its working fine.But in the code i need to only mention the property file name and set the path of this property file in the class path.

say

Properties prop = new Properties(new FileInputStream("test.properties");

and the location c:\example should not be specified here.It should be automatically detected.I tried setting this in the classpath but still it cannot recognise the file location.Kindly help me out.
 
Ranch Hand
Posts: 824
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
check this

http://www.javaworld.com/javaworld/javaqa/2003-08/01-qa-0808-property.html
 
reply
    Bookmark Topic Watch Topic
  • New Topic