Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jdb and jde with emacs ( name unknown)

Tags:

java

emacs

jdb

jde

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.

like image 631
sam-mere Avatar asked Jan 14 '11 04:01

sam-mere


1 Answers

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.

like image 72
Thierry Lam Avatar answered Oct 21 '22 10:10

Thierry Lam