5

main[1] print myVariable

com.sun.tools.example.debug.expr.ParseException: Name unknown: myVariable

myVariable = null

Any guesses as to why this might be happening? I can place breakpoints like I'm used to, but I can't access the variables.

sam-mere
  • 71
  • 4

1 Answers1

7

When you compile your code, make sure you do it debug mode:

javac -g *.java

You should then be able to print the variables during debugging.

Thierry Lam
  • 45,304
  • 42
  • 117
  • 144