Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Beginning Java
Search Coderanch
Advance search
Google search
Register / Login
Win a copy of
Eclipse Collections Categorically: Level up your programming game
this week in the
Open Source Projects
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 ...
Marshals:
Campbell Ritchie
Tim Cooke
paul wheaton
Ron McLeod
Jeanne Boyarsky
Sheriffs:
Paul Clapham
Saloon Keepers:
Tim Holloway
Roland Mueller
Bartenders:
Forum:
Beginning Java
How to specify the ResourceBundle file
Mullin Yu
Greenhorn
Posts: 14
posted 20 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
hi, i have write a separate class to store the configuration at config.properties.
but, how i can tell the
java
vm to use it?
e.g. java testdemo
import java.util.ResourceBundle;
public class Resource {
private static final
String
BUNDLE_NAME = "config";//$NON-NLS-1$
private static ResourceBundle RESOURCE_BUNDLE = ResourceBundle
.getBundle(BUNDLE_NAME);
...
...
}
Jeroen Wenting
Ranch Hand
Posts: 5093
posted 20 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
yup, that would work if that were indeed the name of the properties file and it were in the root of the classpath.
42
The fastest and most reliable components of any system are those that are not there. Tiny ad:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Can i keep a configFile in webapp?
Usage of Resource Bundles and Memory consumption
Trying to update a ResourceBundle and to refresh the swing interface
Properties File from Jar
Applet always use same Resource file
More...