[java] Eclipse Error: "Failed to connect to remote VM"

I tried several things mentioned here, but the below method worked for me:

Go to Debug Console of Eclipse, where you will find the name of the process which is already existing there. Right click on that process and select "Terminate and Remove", this will terminate the process. Now try initiating the process again and it will work.