Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialVictor Curtis Jr
5,268 PointsGetting 1 Error when Compiling
I'm getting one error when compiling and don't know how to fix it. Here is my code.
public class Hangman {
public static void main(String[] args) {
if (args.length == 0) {
System.out.println("Usage: java Hangman <answer>");
System.err.println("answer is required");
System.exit(1);
}
Game game = new Game(args[0]);
Prompter prompter = new Prompter(game);
while (game.getRemainingTries() > 0) && !game.isWon()) {
prompter.displayProgress();
prompter.promptForGuess();
}
prompter.displayOutcome();
}
}
The error I'm getting is this:
treehouse:~/workspace$ javac Hangman
Picked up JAVA_TOOL_OPTIONS: -Xmx128m
Picked up _JAVA_OPTIONS: -Xmx128m
error: Class names, 'Hangman', are only accepted if annotation processing is explicitly requested
1 error
Please help. I have no idea what to do or how to fix it. Thanks!
1 Answer
<noob />
17,062 Pointspost the all code please with a proper formatting