Results 1 to 2 of 2
Thread: Question Creating a .jar
- 05-18-2011, 08:01 PM #1
Member
- Join Date
- May 2011
- Posts
- 8
- Rep Power
- 0
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?Java Code:File f = new File("dictionary.txt");
- 05-18-2011, 08:15 PM #2
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)How to Ask Questions the Smart Way
Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!
Similar Threads
-
Question about creating jar file
By hei1233212000 in forum New To JavaReplies: 3Last Post: 10-27-2010, 02:41 PM -
Question about creating a Game State Manager
By nolsen01 in forum New To JavaReplies: 1Last Post: 03-05-2010, 10:23 PM -
hard question .. help me .. about creating random numbers
By soldier in forum New To JavaReplies: 5Last Post: 12-21-2009, 01:17 PM -
Creating files stopped creating...
By Dieter in forum Advanced JavaReplies: 3Last Post: 09-25-2009, 11:45 PM -
Creating objects question
By sergm in forum New To JavaReplies: 2Last Post: 12-27-2007, 04:10 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks