Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Where to place .properties file? for ResourceBundle
I had been trying to use a ResourceBundle object, but I can't figure it out where to place my rsc/language.properties
Plus I don't want to specify Location like "_en, en_US, _es", I just want to use it
I am doing this:
esourceBundle.getBundle("rsc/language");
that throws:
java.util.MissingResourceException: Can't find bundle for base name rsc/language, locale en_US
Actually I have it in:
src/main/java/rsc/language.properties
I thought that because of what exception says I would be forced to add:
src/main/java/rsc/language_en.properties
src/main/java/rsc/language_en_US.properties
..but DIDN'T work either!
WHERE this/these files should be placed?
I had to remove the rsc/ path and created a folder in WEB-INF/classes/languange.properties
Place you properties files into Project/src/main/resources
and use maven-resources-plugin in pom file:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.7</version>
<configuration>
<encoding>${project.encoding}</encoding>
</configuration>
</plugin>
in java code just call
messages = ResourceBundle.getBundle("MessagesBundle", getLocale());