MissingResourceException: Can't find bundle base name
<p>When running a jar file that i created from a maven project as such:</p>

<pre><code>java -jar basictool.jar
</code></pre>

<p>I get this error exception:</p>

<pre><code>    Exception in thread "main" java.lang.reflect.InvocationTargetException 
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
    Caused by: java.util.MissingResourceException: Can't find bundle for base name com/kit/version, locale en_US
        at java.util.ResourceBundle.throwMissingResourceException(UnknownSource)
        at java.util.ResourceBundle.getBundleImpl(Unknown Source)
        at java.util.ResourceBundle.getBundle(Unknown Source)
        at com.factories.FactoryImpl.&lt;init&gt;(FactoryImpl.java:80)
        at com.parsers.BasicParser.&lt;init&gt;(BasicParser.java:32)
        at com.parsers.FileParser.&lt;init&gt;(FileParser.java:76)
        at com.tools.BasicTool.main(BasicTool.java:75)
    ... 5 more
</code></pre>

<p>I created the jar file by using the maven jar creation wizard:
<strong>Right-click on project, select Export > Java > Runnable JAR file</strong> with options</p>

<p>Launch configuration: <strong>BasicTool - work</strong></p>

<p>Export destination: <code>C:\Users\Victor\Documents\basictool.jar</code></p>

<p>Library handling: <strong>Package required libraries into generated JAR</strong></p>

<p>The version.properties file is kept inside of the <code>src/main/resources</code>, as <code>com/kit/version.properties</code>.</p>

<p>I have checked that the version.properties file is found inside of the jar file by running:</p>

<pre><code>jar tf basictool.jar &gt; output.txt
</code></pre>

<p>where i find the version.properties file as such:</p>

<pre><code>resources/com/kit/version.properties
</code></pre>

<p>I attempt to load the resource like this:</p>

<pre><code>ResourceBundle.getBundle("com/kit/version");
</code></pre>

<p>My machine and environment specifications are as followed:
<strong>Windows 7, Spring version: 3.7.2</strong>.</p>

<p>Note:
I found many questions similar to the one i have, but the answers i have found point to the properties file being properly named or placed in the correct location. From those answers i learned that version.properties is fine, since <code>ResourceBundle.getBundle("com/kit/version")</code> will first look for version.class then version.properties by default. It will also look for version_en_US.properties before ultimately looking for the base name version.properties.
I seem to be in line with the above, since the file version.properties is in the correct location and named correctly. I also seem to be in line with what other answers have offered :(</p>

<p>I would also like to point out that it finds the resource just fine when i run the program from spring, which brings me to suspect that something about the jar's creation process is the cause of the problem.</p>

<p>And it is also important to note that the properties file is in another maven project.</p>

<p>I hope i offered enough/clear details. Any help would be appreciated, thank you in advance!</p>