问题
My Java version is 1.8.0_6. The JDB on my laptop can be started with a .class file, say MyClass.class. But after I type
run
conmmand, JDB first gives me a prompt "run MyClass", then it is stuck for a while. After that, it throws out the following error information,
VM start exception: VM initialization failed for: /Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/jre/bin/java -Xdebug -Xrunjdwp:transport=dt_socket,address=promote.cache-dns.local:58261,suspend=y DebugMe
ERROR: transport error 202: connect failed: Operation timed out ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510) JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized [debugInit.c:750] FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)
Fatal error: Target VM failed to initialize.
I have been compiling and running Java programs with "javac" and "java" properly in recent days. But I never used jdb before. Could anybody help me with this? Thanks in advance.
回答1:
I had the same issue, it is likely that
your host name promote.cache-dns.local
actually resolves to your external IP, but your firewall blocks it.
Quick fix for me was adding my hostname to /etc/hosts
as 127.0.0.1 my-host-name
来源:https://stackoverflow.com/questions/33721486/jdb-does-not-work-on-os-x-10-11