Intellij Idea Maven 'cannot reconnect' error

I was facing the same error and fixed it like that:

  1. Open settings by pressing Ctrl+Alt+S and navigate to Build, Execution, Deployment | Build Tools | Maven | Importing

  2. Check JDK for Importer and change the exact version of JDK (example : 1.8.0.250) installed on your machine from the drop-down.

enter image description here

After doing the same it prompts for verification and after that, the maven will be automatically updated and the project will run.

In my case, I did the same thing as the JDK which is used in the machine is different when the project is imported from a repository. These things happen when we uninstall the IDE and JDK and install the IDE and different version of JDK, the IDE automatically fetch the project which is available in the machine as before but it can not change the imported JDK.


I fixed this by changing my local Maven 3.3.9 to Idea Bundle Maven3.