GetBundle cannot find property file

I am trying to use a properties file to store google merchant information. When i callResourceBundle.getBundle("com_google_checkout_example_settings");

I get an error message:

java.util.MissingResourceException: Can't find bundle for base name com_google_checkout_example_settings, locale en_US

Where do I need to put the properties file so getBundle () can find it? Do I need to add a locale to the properties file?

+3
source share
2 answers

The file should be included in your classpath. If it is already included, but located inside the package, you need to provide the full path - that is:ResourceBundle.getBundle("com/google/example/checkout_settings.txt")

+5
source

Where do I need to put the properties file

Put in the classpath for the runtime to be available.

for a web application put it in WEB-INF/classes/for jar, add it to some package, and then

ResourceBundle.getBundle("some/package/resources.properties");
+2
source

All Articles