So there are several ways to get a resource from a jar and each has slightly different syntax where the path needs to be specified differently.
The best explanation I have seen is this article from InfoWorld. I'll summarize here, but if you want to know more you should check out the article.
Methods
ClassLoader.getResourceAsStream()
.Format: "/"-separated names; no leading "/" (all names are absolute).
Example: this.getClass().getClassLoader().getResourceAsStream("some/pkg/resource.properties");
Class.getResourceAsStream()
Format: "/"-separated names; leading "/" indicates absolute names; all other names are relative to the class's package
Example: this.getClass().getResourceAsStream("/some/pkg/resource.properties");
Updated Sep 2020: Changed article link. Original article was from Javaworld, it is now hosted on InfoWorld (and has many more ads)