Well, I'm working on the hangman program. We were told to do it with three classes, a hangman class, an interface class and a tester class. I got the program working at school last night, but when I loaded it at home, it doesnt compile right. The hangman class will compile fine, but the interface wont recognize the hangman class, I get the following message.

F:\hangman\Interface.java:5: cannot find symbol
symbol : class Hangman
location: class Interface
private Hangman logic;
^
F:\hangman\Interface.java:7: cannot find symbol
symbol : class Hangman
location: class Interface
public Interface(Hangman l)
^
2 errors

Tool completed with exit code 1

this also happens with a previous project of mine so I assume it's something set up in my computer. Any ideas?

Recommended Answers

All 6 Replies

Looks like you need to compile the hangman class first.

I already tried that several times, and it still doesnt work.

Member Avatar for iamthwee

Er are you using the latest download of the Jdk and j2re on your computer?

I know I'm using the latest JDK, but not sure about the J2re

Hi rabidpanda,

It could be a classpath issue. Is Hangman.java in the same directory as your other two files? If not, try setting the classpath explicitly using the -classpath command-line option to javac.

setting the classpath in the control panel did it. Thanks for the help.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.