I am encountering an issue when trying to load a resource.
java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("Bundle");
My file is correctly named Bundle_en_US.properties
in the src
folder.
While I am aware of this solution (and many others), my case is different because my Java program runs fine from Eclipse but the error below is triggered when ran from an executable jar file.
Exception in thread "AWT-EventQueue-0" java.util.MissingResourceException: Can't find bundle for base name Bundle, locale en_US
at java.util.ResourceBundle.throwMissingResourceException(Unknown Source)
at java.util.ResourceBundle.getBundleImpl(Unknown Source)
at java.util.ResourceBundle.getBundle(Unknown Source)
I am using: Windows 10, Eclipse Photon, JDK 8 and JDK 10, JRE 8 and JRE 10
And I can see all my *.properties files in the jar file when opening with an archive manager :