Question Creating a .jar
I've created a Scrabble game and it works fine, but when I try to create a .jar file for it to make it easier to run it doesn't work because it loads the "dictionary" from a text file which isn't included in the .jar. So how do I create a .jar and have it include the text file or modify my code so it loads it anyway?
The code used to load the file is basically:
I also have functionality to save and load games from files (using PrintWriter and Scanner); I don't think that will work with a .jar either which I can deal with... unless there's an easy fix?
File f = new File("dictionary.txt");
How are you creating the Jar? Are you using an IDE, or doing it from the command line?
Recommended reading: Lesson: Packaging Programs in JAR Files (The Java™ Tutorials > Deployment)