G
gerrymcc
Hi,
I've got a loop which is going through an array, and I'm getting an
array index out of bounds exception. Usually to find this sort of
error I'd use System.out.println() or look at the code until the penny
drops, but I think it must be quicker to use the debugger. I want to
see the local variables in the loop, so I recompiled the class with
the loop, and the main class. The debugger says to recompile with -g
so I did:
javac -g TheMainClass.java, and javac -g TheLoopClass.java.
Then when I run the program and the debugger stops at the exception,
I type locals and the debugger still says recompile with -g.
Does that mean I need to recompile every class the program is using?
Also, is there any tutorial or instructions for using the debugger?
Documentation for any standard debugger would probably explain some of
the general priciples I need to know.
Thanks for any help,
Gerard
I've got a loop which is going through an array, and I'm getting an
array index out of bounds exception. Usually to find this sort of
error I'd use System.out.println() or look at the code until the penny
drops, but I think it must be quicker to use the debugger. I want to
see the local variables in the loop, so I recompiled the class with
the loop, and the main class. The debugger says to recompile with -g
so I did:
javac -g TheMainClass.java, and javac -g TheLoopClass.java.
Then when I run the program and the debugger stops at the exception,
I type locals and the debugger still says recompile with -g.
Does that mean I need to recompile every class the program is using?
Also, is there any tutorial or instructions for using the debugger?
Documentation for any standard debugger would probably explain some of
the general priciples I need to know.
Thanks for any help,
Gerard