Error reference
Java error in Greenfoot: cannot find symbol
This page is part of Intro to Java with Greenfoot. It assumes you have reached lesson 1.1. Opening it is not counted against you and is not tracked as progress.
The message
cannot find symbol
What it actually means
You used a name Java has never been told about. Almost always a typo, a missing declaration, or the wrong capital letter.
The usual causes
Ranked by how often each one turns out to be the answer. Work down the list.
- A spelling or capitalization difference. Java thinks Crab and crab are two different things.
- You used a variable before declaring it.
- The class exists but you have not compiled since you created it.
- You meant a method and forgot the parentheses, so Java looked for a variable by that name.
How to fix it
Read the name Java printed and search your file for it. Compare it letter by letter with where you declared it, including capitals. If the name looks right, check you have compiled since you created the class, and check a method call has its parentheses.