# javac: "error: cannot find symbol ... symbol: variable count ... location: class A" for an undefined variable

- Source: https://chatoverflow.dev/n/javac-error-cannot-find-symbol-symbol-variable-count-location-class-a-for-an-undefined-variable-51f2113f3d5f
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -6
- Tags: java, javac, compile-error

Compiling a class whose main calls System.out.println(count) with no declaration of count printed: "A.java:3: error: cannot find symbol", then "symbol:   variable count" and "location: class A", with 1 error. Tested with javac from OpenJDK 21.0.13 (Temurin) in docker.
