| | |
jdb run time input needed
![]() |
•
•
Join Date: Jun 2007
Posts: 25
Reputation:
Solved Threads: 1
Hello all,
I have a program running with this command 'jdb prog'. It was compiled with 'javac -g prog.java'. The program when running normally asks for input, 1st it asks for a number then it asks for a second number. When running in jdb it still asks for input so I type '5', for exmple, and jdb says "Unrecognized command: '5'. Try help...."
How do I tell jdb to send a number or string for that matter to the running program?
thank you,
Mike
I have a program running with this command 'jdb prog'. It was compiled with 'javac -g prog.java'. The program when running normally asks for input, 1st it asks for a number then it asks for a second number. When running in jdb it still asks for input so I type '5', for exmple, and jdb says "Unrecognized command: '5'. Try help...."
How do I tell jdb to send a number or string for that matter to the running program?
thank you,
Mike
jdb says? or prog says? does prog accept arguments when called or when during execution?
do you actually call run to start prog execution?
do you actually call run to start prog execution?
•
•
Join Date: Jun 2007
Posts: 25
Reputation:
Solved Threads: 1
I run the program like this 'java prog'. When I run do, 'prog' asks for 2 numbers, 1 after the other. Then it does a computation on them.
I am trying to debug my program. I use jdb. I start it with 'jdb prog'. While in jdb, I tell it to start executing prog by typing 'run'. jdb runs prog and prog asks for a number. It will wait on that number. I type a number but jdb thinks it is a command. and replies "Unrecognized command: '5'. Try help....". I need to tell jdb to pass the number I typr to prog so it will continue execution.
I hope this clears things up and has not made you more confused.
Mike
I am trying to debug my program. I use jdb. I start it with 'jdb prog'. While in jdb, I tell it to start executing prog by typing 'run'. jdb runs prog and prog asks for a number. It will wait on that number. I type a number but jdb thinks it is a command. and replies "Unrecognized command: '5'. Try help....". I need to tell jdb to pass the number I typr to prog so it will continue execution.
I hope this clears things up and has not made you more confused.
Mike
if you are debugging your app, i assume you have some breakpoints defined. are you hitting one of these breakpoints and not knowing it? make sure you step past any breakpoints you may have. if you are querying for user inputs, it would be logical to have prompts so the user knows when to input values too.
You'll probably have to attach the debugger from a separate command window.
From the Sun doc on jdb:
From the Sun doc on jdb:
•
•
•
•
For example, the following command will run the MyClass application, and allow jdb to connect to it at a later time.
% java -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n MyClass
You can then attach jdb to the VM with the following commmand:
% jdb -attach 8000
![]() |
Other Threads in the Java Forum
- Previous Thread: Trouble in Desktop sharing code
- Next Thread: Java help!
| Thread Tools | Search this Thread |
911 addball addressbook android api append applet application apps array arrays automation binary bluetooth businessintelligence button card chat class client code collision component crashcourse css csv database eclipse ee error fractal free game gis givemetehcodez graphics gui html ide image input integer integration j2me japplet java javaarraylist javadoc javafx javaprojects jni jpanel julia jvm linux list loan loop machine map method methods migrate mobile netbeans newbie objects oriented output panel phone physics problem program programming project radio recursion reporting scanner se server service set sms socket software sort sql string swing test textfield threads transfer tree trolltech ubuntu utility windows






