Search code examples
javavisual-studio-codegradlegradle-plugin

No Connection To Gradle Server && The Gradle Client Was Unable To Connect in Visual Studio Code


I am new to Java Projects in Visual Studio Code. This is mainly for my school project. I was setting up Gradle for Java according to YouTube videos and follows the step. I just simply installed the "Gradle for Java" in Visual Studio Code but I have an error. I have restarted and reconnected it but it is showing no progress. Any help will be appreciated. Cheers!

Error: No Connection To Gradle Server. Try Restarting The Server. Error: The Gradle Client Was Unable To Connect. Try re-connecting.

No Connection To Gradle Server. Try Restarting The Server && The Gradle Client Was Unable To Connect. Try re-connecting.

I tried restarting my PC, Vscode and even followed the instructions to reconnect but I am not really sure what does Restart Server means. I would like to acquire some answers and eventually able to run Gradle on Vscode.


Solution

  • SOLUTION:

    1. Go to the Windows search bar.
    2. Type "Edit the System Environment Variables".
    3. In the "Adavance" tab click "Environment Variables".
    4. Go to "System Variables".
    5. Check if you have made an option for "JAVA_HOME".
    6. If there is no "JAVA_HOME". Click "New" and provide the name "JAVA_HOME" then save it.
    7. Click "Edit" and enter the path of your JDK.

    e.g C:\Program Files\Eclipse Adoptium\jdk-17.0.6.10-hotspot

    I hope it helps, Happy Coding!