Computing.Net > Forums > Programming > java & debugging with jdb

java & debugging with jdb

Reply to Message Icon

Original Message
Name: mitra
Date: September 27, 2002 at 04:22:41 Pacific
Subject: java & debugging with jdb
OS: Redhat Linux 7.3
CPU/Ram: Intel 500 , 128 mg
Comment:

I am new to debugging with jdb
I wrote the folowing program
from TIJ3(thinking in java) book and I save it
X1:SimpleDebugging.java
// {ThrowsException}
public class SimpleDebugging {
private static void foo1() {
System.out.println("In foo1");
foo2();
}

private static void foo2() {
System.out.println("In foo2");
foo3();
}

private static void foo3() {
System.out.println("In foo3");
int j = 1;
j--;
int i = 5 / j;
}

public static void main(String[] args) {
foo1();
}
} ///:~

then I compile it with
"javac -g SimpleDebugging.java"
then to debug my program I
say:
"jdb SimpleDebugging"
then
jdb says:
"Initializing jdb...
>"
then I say
"catch Exception"
it answers
"Deferring exception catch Exception.
It will be set after the class is loaded.
>"
then I command to run
"run"
and it answers
"run SimpleDebugging
java.net.UnknownHostException: localhost.localdomain
at java.net.InetAddress.getAllByName0(InetAddress.java:571)
at java.net.InetAddress.getAllByName0(InetAddress.java:540)
at java.net.InetAddress.getAllByName(InetAddress.java:533)
at java.net.InetAddress.getLocalHost(InetAddress.java:723)
at com.sun.tools.jdi.SocketTransport.startListening(SocketTransport.java:94)
at com.sun.tools.jdi.SocketTransport.startListening(SocketTransport.java:89)
at com.sun.tools.jdi.SunCommandLineLauncher.launch(SunCommandLineLauncher.java:116)
at com.sun.tools.example.debug.tty.VMConnection.launchTarget(VMConnection.java:266)
at com.sun.tools.example.debug.tty.VMConnection.open(VMConnection.java:134)
at com.sun.tools.example.debug.tty.Commands.commandRun(Commands.java:398)
at com.sun.tools.example.debug.tty.TTY.executeCommand(TTY.java:393)
at com.sun.tools.example.debug.tty.TTY.(TTY.java:625)
at com.sun.tools.example.debug.tty.TTY.main(TTY.java:924)
Fatal error:

Unable to launch target VM.
"
and it dies.
I don't know what should I do please help me
I can't run jdb for anny programm still now.
"OS: redhat linux 7.3
java compiler: java version "1.3.1"
Java(TM) 2 Runtime Environment, Standard Edition (build Blackdown-1.3.1-FCS)
Java HotSpot(TM) Client VM (build Blackdown-1.3.1-FCS, mixed mode)"



Report Offensive Message For Removal


Response Number 1
Name: vitp
Date: September 27, 2002 at 05:01:05 Pacific
Reply: (edit)

Please try to run jdb by:
jdb -classpath SimpleDebugging

I suspect jdb cann't find SimpleDebugging class to load the one.


Report Offensive Follow Up For Removal

Response Number 2
Name: mitra
Date: September 27, 2002 at 08:31:24 Pacific
Reply: (edit)

I try it but it doesn't work!!


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: java & debugging with jdb

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software




Have you ever used OpenOffice?

Yes, as my main suite.
Yes, occationally.
Yes, but only once.
No, never.


View Results

Poll Finishes In 3 Days.
Discuss in The Lounge