Ho un test molto semplice proprietà di file Sto cercando di ottenere di lavoro: (il seguente è TestProperties.java)dove inserire i file .properties in un progetto Eclipse?
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);
}
}
}
e TestProperties.properties nella stessa directory:
something=this is something
something.else=this is something else
che ho hanno anche salvato TestProperties_en_US.properties
Quando eseguo TestProperties.java da Eclipse, non si riesce a trovare il file delle proprietà:
java.util.MissingResourceException:
Can't find bundle for base name TestProperties, locale en_US
Sto facendo qualcosa di sbagliato?