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 trial

Java Java Basics Getting Started with Java Strings and Variables

Dylan Anderton
Dylan Anderton
8,163 Points

Error: cannot find symbol

Update: derp... simple mistake.

I copied the code from the video but still receive this error. It can't find the period in the console.printf method? Any help for this one?

import java.io.Console;

public class Introductions {

public static void main(String[] args) {
    Console console = System.console();
    // Welcome to the Introductions program!  Your code goes below here

  console.prinf("Hello World!");

} }

Picked up JAVA_TOOL_OPTIONS: -Xmx128m
Picked up _JAVA_OPTIONS: -Xmx128m
Introductions.java:9: error: cannot find symbol
console.printf("Hello World!");
^
symbol: method prinf(String)
location: variable console of type Console
1 error

2 Answers

saykin
saykin
9,835 Points

Hi, there is an spelling error in your console.printf line. You're missing the letter 't'.

Dylan Anderton
Dylan Anderton
8,163 Points

Wow... Derp. Thank you, ugh. xD

saykin
saykin
9,835 Points

Happens to the best of us, in the future, look at the error message, it will save you a lot of headache when it comes to compilation errors.

It says:

Introductions.java:9:error: cannot find symbol
console.printf("Hello World!");
^
symbol: method prinf(String)

The error was at line 9 in file/class Introductions.java and that it couldn't find the symbol on that line, which basically means it can't find the method/variable prinf(String). So either spelling error or you haven't linked some other file/class that has the method/variable.

Dylan Anderton
Dylan Anderton
8,163 Points

Thank you for this tip, I will use this in the future!