致命错误:无法启动目标虚拟机



我是java和jdbc的新手,试图调试一个示例程序:

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:UserstestworkspacesampleJava>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.

据我所知:jdbc无法加载类。是否有任何路径设置,我需要设置jdbc。(我试图遵循这个教程)

我想我错过了一个非常基本的东西。试过谷歌,但同样的想法,但我无法解决问题。
My PATH=%SystemRoot%system32;%SystemRoot%;%SystemRoot%System32Wbem;%SYSTEMROOT%System32WindowsPowerShellv1.0;C:cygwin;C:UserstestDownloadsadt-bundle-windows-x86-20130219adt-bundle-windows-x86-20130219sdkplatform-tools;"C:Program FilesJavajre1.6.0_16bin";"C:Program FilesJavajre6bin";"C:Program FilesJavajdk1.6.0_45bin";C:UserstestDownloadsadt-bundle-windows-x86-20130219adt-bundle-windows-x86-20130219sdktools;"C:Program FilesGraphviz2.26.3bin";"C:Program FilesGraphviz2.26.3bin"

C: workspace 测试用户学习java - version>Java版本"1.6.0_45"Java(TM) SE运行环境(build 1.6.0_45-b06)Java HotSpot(TM) Client VM (build 20.45-b01,混合模式,共享)

C: workspace 测试用户学习> javac - versionjavac 1.6.0_45

操作系统:windows 7

遇到了同样的问题-似乎是由于jdk安装在路径中带有空格的文件夹中,即"Program Files" -将jdk安装到c:jdk中,问题就消失了

相关内容

  • 没有找到相关文章

最新更新