Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Persistent properties?

 
Duncan Fawkes
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all. I have a question regarding persisting properties I want to load into my class when it is constructed, and the options I have available to me to do this.
Basically, when my class is constructed I want to load a property for it to use. As far as I know, I can do this either using -D in the Java command, or loading the property from a text file. However, where does the runtime find the file (using a property to find a property?! ). Could someone tell me how best to handle this situation please (ie what is convention)?? Personally, I would've thought that there would be a Windows registry type object that you could use to set properties...
dUNC
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When we start an application we use a bat file. This file can set the classpath on the way in and name the properties file as an input parameter.

>java -classpath .;\whatever AppStartClass App.properties
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic