We should load it from the classpath instead of as a file if we want to be able to load it from a jar. We want the Class.getResourceAsStream() method or the ClassLoader.getResourceAsStream() method.
Example:
properties.load(MsgBuilder.class.getResourceAsStream("/errormessages.properties")
Example:
properties.load(MsgBuilder.class.getResourceAsStream("/errormessages.properties")