Getting a handle on a resource in a Jar file (without directly getting an InputStream) is tricky. Here's the way to do it: toExternalForm().
File f = new File(getClass().getResource("/MyResource").toExternalForm());