eclipse中出现Cannot find a free socket for the debugger解决方法

最近使用eclipse时,使用Debug As出现了错误提示“Cannot find a free socket for the debugger”。如图所示:

eclipse中出现Cannot find a free socket for the debugger解决方法

于是,百度了一下解决方法,无明显效果。有一种比较可信的方案是在命令行工具里输入重置网络命令,即在命令行工具输入netsh winsock reset。然而,可能作者阐述不清,导致很多人跟我一样,无法解决问题。我就是直接输入,遇到了提示说“'netsh' 不是内部或外部命令,也不是可运行的程序”。

eclipse中出现Cannot find a free socket for the debugger解决方法

这里,我不解释太多原理性话语,以我的win10系统直接具体解释我的解决步骤。

第1步,以管理员身份运行命令提示符。命令提示符可以在左下角找找,每个人电脑可能有略微不同。

eclipse中出现Cannot find a free socket for the debugger解决方法

第2步,输入netsh winsock reset命令,注意不要在末尾加符号!

eclipse中出现Cannot find a free socket for the debugger解决方法

第3步,重启计算机,打开eclipse,就可以正常运行!

eclipse中出现Cannot find a free socket for the debugger解决方法