File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Persistent properties? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Persistent properties?" Watch "Persistent properties?" New topic

Persistent properties?

Duncan Fawkes

Joined: Jul 17, 2001
Posts: 10
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...
Cindy Glass
"The Hood"

Joined: Sep 29, 2000
Posts: 8521
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

"JavaRanch, where the deer and the Certified play" - David O'Meara
I agree. Here's the link:
subject: Persistent properties?
It's not a secret anymore!