[java] Can't find bundle for base name

I'm using a library that has a dependency on jfreechart (v 1.0.9).

When I try to run the .jar, I get:

java.util.MissingResourceException: Can't find bundle for base name
        org.jfree.chart.LocalizationBundle, locale en_US
    at java.util.ResourceBundle.throwMissingResourceException
        (ResourceBundle.java:1521)
    at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1260)
    at java.util.ResourceBundle.getBundle(ResourceBundle.java:962)

I've tried creating a LocalizationBundle.properties file, but that didnt do it. I've checked the CLASSPATH, still no go.

Any ideas?

This question is related to java jfreechart

The answer is


BalusC is right. Version 1.0.13 is current, but 1.0.9 appears to have the required bundles:

$ jar tf lib/jfreechart-1.0.9.jar | grep LocalizationBundle.properties 
org/jfree/chart/LocalizationBundle.properties
org/jfree/chart/editor/LocalizationBundle.properties
org/jfree/chart/plot/LocalizationBundle.properties

When you create an initialization of the ResourceBundle, you can do this way also.

For testing and development I have created a properties file under \src with the name prp.properties.

Use this way:

ResourceBundle rb = ResourceBundle.getBundle("prp");

Naming convention and stuff:

http://192.9.162.55/developer/technicalArticles/Intl/ResourceBundles/

If you are using IntelliJ IDE just right click on resources package and go to new and then select Resource Boundle it automatically create a .properties file for you. This did work for me .