You can't access a resource in a Jar file via java.io.File. You should provide an alternate constructor for SentenceDetector which either accepts an InputStream rather than a String, or which accepts an URL and uses URL.openStream() to get an InputStream.