当我尝试在浏览器中远程调试小程序时,会发生此错误:Failed to connect to remote VM
。拒绝连接。为什么它可以占据一席之地?以下是我的行动:
1. javac -g TestApplet.java
2. create html file specifying TestApplet.class
3. in java control pannel: -Djava.compiler=NONE -Xnoagent -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n
4. open in browser html file with applet
5. in the eclipse in applet's code set a breakpoint
6. debug configuration -> remote java configuration create new config with parameters: SocketAttach, localhost, 8000
7. debug
之后:错误消息 - 无法连接到远程虚拟机。连接被拒绝。如何解决此错误?