File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Property files in java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Property files in java" Watch "Property files in java" New topic
Author

Property files in java

Uma Reddy
Greenhorn

Joined: Apr 16, 2010
Posts: 4
How does java know to load the correct property file. We have development, integration and acceptance environments. How does java pick the right property file corresponding to each environment. I will appreciate if someone can explain clearly how java does it. Thank You, Uma
Satya Sakhinetipalli
Greenhorn

Joined: May 16, 2008
Posts: 7
Define an environment variable some value (tier name can be the value) and respective properties file is loaded for that tier. ex :

-DCONFIG_MODE=dev in development and properties file related to dev is loaded.

David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Java has no default mechanism for doing this. As Satya implies, there must be some way of defining which file to load. There are, however, a whole bunch of ways this could be implemented.
 
Consider Paul's rocket mass heater.
 
subject: Property files in java