Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

build problems and relative paths

Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am creating a executable jar for my application. I am facing some problems
1) My Application contains a properties file which contains a key value pair which reference a location of the file
CONFIG_FILE=C:/Program Files/eclipse/workspace/First/XML/Test.xml
This MyProperty file and the Test.xml are also included in my jar file.

So this renders my hardcoded location useless, because when a person downloads my jar and runs the executable the path C:/Program Files/eclipse/workspace/First/Test.xml cannot be found.

How do I overcome this problem?. How I can use a relative file path, which will change with the location of the jar

say I download the jar to C:/sample directory how will the location of the property CONFIG_FILE in MyProperty file reflect to C:/Sample/XML/Test.xml

Ranch Hand
Posts: 1296
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This article may be of use to you.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic