Search code examples
javamavenintellij-idea

Fix Intellij Idea download sources Connection Refused to host 127.0.0.1 error


When I try to download sources of a library class pulled by Maven I receive error in Intellij IDEA:

java.rmi.ConnectException: Connection refused to host: 127.0.0.1

Solution

  • UPD (from @Andrey): This might have been fixed in version 2021.1.3

    For older versions:

    This can be fixed by selecting a proper JDK in your project's Maven Importer setting.

    In the project setting go to Build Tools -> Maven -> Importing

    Set JDK for importer to the JDK installed on your OS (Not the built-in one)

    Try to download sources again - should be working now.

    fix download sources connection refused