where to put .properties files in an Eclipse project?

Posted by Jason S on Stack Overflow See other posts from Stack Overflow or by Jason S
Published on 2009-04-17T22:45:30Z Indexed on 2010/06/04 6:49 UTC
Read the original article Hit count: 256

Filed under:
|
|

I have a very simple properties file test I am trying to get working: (the following is TestProperties.java)

package com.example.test;

import java.util.ResourceBundle;

public class TestProperties {
    public static void main(String[] args) {
    	ResourceBundle myResources =
    	      ResourceBundle.getBundle("TestProperties");
    	for (String s : myResources.keySet())
    	{
    		System.out.println(s);
    	}
    }

}

and TestProperties.properties in the same directory:

something=this is something
something.else=this is something else

which I have also saved as TestProperties_en_US.properties

When I run TestProperties.java from Eclipse, it can't find the properties file:

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

Am I doing something wrong?

© Stack Overflow or respective owner

Related posts about java

Related posts about eclipse