• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Jar a project with property files in it external to jar

 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a java class which reads some properties from a property file(which contains database server urls username and passwords).I want
to jar the class file and give it to the some other project so that they can just change the properties file if needed and use the jar file in their project . When i make the jar file ,i see that the property file is inside the jar file and is not user freindly to modify.
I would appricate if someone could help me to know ,
"How can we make a jar file so that its properties file are exteranal to jar".
 
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
They can put you properties file in their own classpath. You have something like this.
/lib/Class1.class
/lib/Class2.class
/lib/Class3.class
/lib/config.properties

Your clients have something like this.
/new/ClassA.class
/new/ClassB.class

Then you jar all your .class files in lib.jar. (without the config.properties)

So your clients want to use your libraries. They can do something like this.
Import/add to classpath your lib.jar
Add a config.properties to their project so it looks like this:
/new/ClassA.class
/new/ClassB.class
/lib/config.properties

They can now jar their project including .class and .properties into new.jar and deploy both lib.jar and new.jar.

I hope it helps
[ September 25, 2007: Message edited by: Jaime Tovar ]
 
kiran kumar
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Jaime Tovar for the reply. I have worked out that in a similar way.

thanks
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic