PDA

Click to See Complete Forum and Search --> : using the debugger (javag)


steve_rm
Nov 16th, 2003, 09:23 PM
Hello

I was using the debugger and stepping through the code, and l want to see what values are currenlty in the variables. I consulted the documentation, and it said l need to compile the program using javag and then run in debug mode, as javag sets up all the information for the variables.

But the problem is when compile in javag e.g. javag MyProgram.java it does not recongize javag.

So l looked in the bin folder, and could not see it there, or anything that looks like it.

Can you help

Many thanks in advance

Steve

CornedBee
Nov 19th, 2003, 05:26 AM
You compile it using javac. There's a compiler switch to add/remove debug info, but I think it's on by default.

The thing is that you need to debug the app while running, and that's quite tricky on the console. You need to start the app with special flags and then start the debugger javad in a second console.

steve_rm
Nov 19th, 2003, 07:51 AM
Thanks for you help.

It seems very complicated from what you said. About the setting of flags. When l read the documentation is said that you only have to compile in javag to get the bug information.

My problem is that l don't have the javag to compile with. example

javag MyProgram.java
and then
javadb MyProgram

That should should, going by the documentation create the bug information.

Any help with the javag will be very grateful

Thanks in advance

Steve

CornedBee
Nov 19th, 2003, 07:55 AM
I never heard of javag, there is certainly no such program in the Sun Java SDK.
However, you can easy debugging if you use an IDE like the free NetBeans (www.netbeans.org).