I have some legacy code that reads a configuration file from an existing jar, like:
URL url = SomeClass.class.getResource(\"/configuration.properties\"); //
There are bugs in several Java versions when using file URLs containing spaces. "/path/to/jar" is probably not your real path, so I at least assume that this is what you're running into. Your code is at least in theory ok.