带有emacs的jdb和jde(名称未知)

sam*_*ere 4 java emacs jdb jde

main [1]打印myVariable

com.sun.tools.example.debug.expr.ParseException:名称未知:myVariable

myVariable = null

有没有猜到为什么会发生这种情况?我可以像我习惯的那样设置断点,但我无法访问变量.

Thi*_*Lam 6

编译代码时,请确保执行调试模式:

javac -g *.java
Run Code Online (Sandbox Code Playgroud)

然后,您应该能够在调试期间打印变量.