当前位置: 首页 > 知识库问答 >
问题:

当我试着调试一个程序时,为什么我得到一个致命的错误?

史智志
2023-03-14

我试图在Eclipse中调试一个简单的java程序,结果出现了以下错误:

本机方法中的致命错误:JDWP未初始化任何传输,jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)错误:传输错误202:连接失败:连接超时错误:JDWPTransport dt_socket未能初始化,TRANSPORT_nit(510)JDWP退出错误AGENT_ERROR_TRANSPORT_ INIT(1907):未初始化传输[debugInit.c:750]

我试着在< code>eclipse.ini文件中设置vm,但是它不起作用

这是我的eclipse.ini

-startup
plugins/org.eclipse.equinox.launcher_1.3.100.v20150511-1540.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.300.v20150602-1417
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vm C:\Program Files\Java\jre1.8.0_45\bin\javaw.exe
-vmargs
-Dosgi.requiredJavaVersion=1.7
-Xms256m
-Xmx1024m

共有1个答案

郎魁
2023-03-14

您必须将-vm放在eclipse.ini文件的开头,并且它必须在两个单独的行上。我认为这无关紧要,但在我的机器上,即使它是Windows,它也使用正斜杠。将其更改为:

-vm
C:/Program Files/Java/jre1.8.0_45/bin/javaw.exe
-startup
plugins/org.eclipse.equinox.launcher_1.3.100.v20150511-1540.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.300.v20150602-1417
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vmargs
-Dosgi.requiredJavaVersion=1.7
-Xms256m
-Xmx1024m

此外,请确认它确实在您计算机上的该位置,而不是其他地方。

 类似资料: