Results 1 to 8 of 8
Thread: Confusion here @@' Help!
- 06-08-2010, 08:22 PM #1
Member
- Join Date
- Jun 2010
- Location
- Singapore
- Posts
- 3
- Rep Power
- 0
Confusion here @@' Help!
My assignment requires me to write a Java computer program that plays a word game called FindYourWords via eclipse
So far my codes are progressing pretty well, but I am stuck in one of ther criteria given here: :(
To check that a word is valid, the computer program must read and store a list of valid words from a text file. The Java code to read words from a text file into string array is given in dictionary.jar. The computer program will use it for comparing with words formed by each player.
The assignment also provides this for me:
Java codes
String dict[] = FileUtil.readDictFromFile("words.txt");
However I have no idea which file to import my Class's src =( and when I import the file that was provided in the assignment there is error in it.. like this: "Source not found, etc etc etc"
Any kind souls out there can help me understanding what's the criteria all about to check if the input word is valid :(?
- 06-08-2010, 09:02 PM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,405
- Blog Entries
- 7
- Rep Power
- 17
You have to put that dictionary.jar file on your classpath; both for your compiler and java.exe itself so your compiler won't whine when it sees the class name FileUtil and your java virtual machine won't protest when it has to execute a method from that class.
kind regards,
Jos
- 06-08-2010, 09:08 PM #3
Is that message from the eclipse program or from javac?"Source not found
Please copy and paste full text of any error messages here.
- 06-08-2010, 09:10 PM #4
- 06-09-2010, 04:15 AM #5
Member
- Join Date
- Jun 2010
- Location
- Singapore
- Posts
- 3
- Rep Power
- 0
I was provided with these files during my assignment:
FileUtil.class (CLASS File)
words (Text Document)
dictionarry (.jar)
I imported both FileUtil.class (CLASS File) & dictionarry (.jar) into my Eclispe Assignment src and I am stucked at there.
For the error in opening the FileUtil.class (CLASS File) in Eclipse is:
Source not found
There is no source file attached to the class file FileUtil.class.
- 06-09-2010, 04:39 AM #6
Member
- Join Date
- Jun 2010
- Location
- Singapore
- Posts
- 3
- Rep Power
- 0
Hi all,
I managed to successfully imported my Jar file in Eclipse via this helpful website here:
http://www.cs.umd.edu/class/fall2005.../advanced.html
However I am still stuck at the error via opening the FileUtil.class (CLASS File) in Eclipse is:
Source not found
There is no source file attached to the class file FileUtil.class.
Is there anything wrong? :(
- 06-09-2010, 03:25 PM #7
Have you tried asking this on an eclipse forum?opening the FileUtil.class (CLASS File) in Eclipse
I have no idea why an IDE would try to open a .class file.
The IDE can't require source for all the .class files that you can use in a program. There are many packages distributed in only .class form.
- 06-09-2010, 03:42 PM #8
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,405
- Blog Entries
- 7
- Rep Power
- 17
I think the OP selected that class name and tried to open its definition. Eclipse tries to find the source for that class and when it can't find it it protests and offers the opportunity to link a file or whatever resource for the source.
I also think that the .jar came with a bit of installation instructions ...
kind regards,
Jos
Similar Threads
-
Boolean confusion
By KM88 in forum New To JavaReplies: 13Last Post: 11-02-2009, 12:44 PM -
Confusion in line
By JavaJunkie in forum New To JavaReplies: 1Last Post: 06-13-2009, 10:46 PM -
confusion in paragraph
By JavaJunkie in forum JavaServer Pages (JSP) and JSTLReplies: 0Last Post: 05-19-2009, 03:02 PM -
Tic Tac Toe confusion
By jigglywiggly in forum New To JavaReplies: 15Last Post: 04-12-2009, 01:47 AM -
bracket confusion...?
By gallimaufry in forum New To JavaReplies: 4Last Post: 10-28-2008, 11:17 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks