문제

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

도움이 되었습니까?

해결책

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

ResourceBundle rb = ResourceBundle.getBundle("dominiondatabase");
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top