getClass().getResource() will look for a resource with the specified name starting from (relative to) the package the class on which you call getClass() is called.
if you want the resource relative from the root of the jar, then you should do getClass().getClassLoader().getResource()