Creating Runnable Jar with external files included

Here’s what you should do instead:

Put that file back in your jar file. Use class.getResourceAsStream() to read it instead of File and FileReader. Here is an explanation of how to do that: How to really read text file from classpath in Java

Leave a Comment