I am new to the java and jdb ,trying to debug an example program :
Foo.java
class Foo {
public static void main(String[] args){
System.out.println("Chexking dalvik virtual machine on system");
}
}
compiled it with -g flag . javac -g Foo.java
compiled properly .
Tried to run program using command >java Foo
Got the output .
Then tried to run : jdb Foo
C:\Users\test\workspace\sampleJava>jdb Foo
Initializing jdb ...
> stop in Foo.main
Deferring breakpoint Foo.main.
It will be set after the class is loaded.
> run main
run main
java.io.IOException: Cannot run program "C:\Program": CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessBuilder.start(ProcessBuilder.java:470)
at java.lang.Runtime.exec(Runtime.java:593)
at java.lang.Runtime.exec(Runtime.java:466)
at com.sun.tools.jdi.AbstractLauncher$Helper.launchAndAccept(AbstractLauncher.java:162)
at com.sun.tools.jdi.AbstractLauncher.launch(AbstractLauncher.java:114)
at com.sun.tools.jdi.SunCommandLineLauncher.launch(SunCommandLineLauncher.java:217)
at com.sun.tools.example.debug.tty.VMConnection.launchTarget(VMConnection.java:334)
at com.sun.tools.example.debug.tty.VMConnection.open(VMConnection.java:166)
at com.sun.tools.example.debug.tty.Commands.commandRun(Commands.java:589)
at com.sun.tools.example.debug.tty.TTY.executeCommand(TTY.java:474)
at com.sun.tools.example.debug.tty.TTY.<init>(TTY.java:707)
at com.sun.tools.example.debug.tty.TTY.main(TTY.java:1011)
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(ProcessImpl.java:177)
at java.lang.ProcessImpl.start(ProcessImpl.java:28)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:452)
... 11 more
Fatal error:
Unable to launch target VM.
To my knowledge : jdb is unable to load the class . Is there any path setting i need to set for jdb . (I was trying to follow this tutorial)
I think i am missing a very basic thing. Tried google but the same think but i couldnt resolve the problem .
My PATH=%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\cygwin\;C:\Users\test\Downloads\adt-bundle-windows-x86-20130219\adt-bundle-windows-x86-20130219\sdk\platform-tools\;"C:\Program Files\Java\jre1.6.0_16\bin";"C:\Program Files\Java\jre6\bin";"C:\Program Files\Java\jdk1.6.0_45\bin";C:\Users\test\Downloads\adt-bundle-windows-x86-20130219\adt-bundle-windows-x86-20130219\sdk\tools;"C:\Program Files\Graphviz2.26.3\bin";"C:\Program Files\Graphviz2.26.3\bin"
C:\Users\test\workspace\sampleJava>java -version java version "1.6.0_45" Java(TM) SE Runtime Environment (build 1.6.0_45-b06) Java HotSpot(TM) Client VM (build 20.45-b01, mixed mode, sharing)
C:\Users\test\workspace\sampleJava>javac -version javac 1.6.0_45
OS: windows 7