Question

I am creating a Java GUI and want to use a resource bundle to store all of my sql queries in a .properties file. My class for loading the resource bundle is in a package in the src/main/java folder where the .properties file is in the src/main/resources folder:

enter image description here

I keep getting a missing resource exception. What am i missing?

Other similar questions say to add the folder to the build path, which it is: build path

This is my call to get the resource bundle:

enter image description here

Was it helpful?

Solution

Remove the .properties file extension to form a correct basename as indicated by the official ResourceBundle guide

ResourceBundle rb = ResourceBundle.getBundle("dominiondatabase");
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top