4

I have the ubiquitous HelloWorldApp.java file

/**
 * The HelloWorldApp class implements an application that
 * simply prints "Hello World!" to standard output.
 */
class HelloWorldApp {
    public static void main(String[] args) {
        System.out.println("Hello World!");
    }
}

I run:

javac HelloWorldApp.java

then I run:

jdb HelloWorldApp

I get:

Initializing jdb ...
> 

I type:

stop at HelloWorldApp.main:7

where prompted

then I get

Deferring breakpoint HelloWorldApp.main:7.
It will be set after the class is loaded.
>

I type:

run

where prompted

then I get

Set uncaught java.lang.Throwable
Set deferred uncaught java.lang.Throwable
> 
VM Started: Hello World!

The application exited

I didn't type anything on that last prompt it just exited without breaking. My question is why did it output those Throwable lines and why didn't the debugger stop at the breakpoint I gave it?

mpdunson
  • 227
  • 1
  • 11

1 Answers1

5

I just checked the syntax for stop in JDB Documentation

stop in <class-name>.<method-name>  Stop on entry to the given method.
stop at <class-name>:<line-number>  Stop at the given line.

I think you command for stop should be either one of the following

stop in HelloWorldApp.main 
stop at HelloWorldApp:7

Give it a try to see that fixes your issue!

ganeshvjy
  • 399
  • 1
  • 12