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

4

5

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.

Marquardt answered 22/7, 2023 at 13:56 Comment(4)
Have you set the correct JDK? Was this link helpful?Concerning
Hi! I am sorry for no update, I have figured it out and it is the configuration of JAVA_HOME in path variables. Thank you for replying to my question I really appreciated it!Marquardt
Welcome to StackOverflow. If you find the solution, Please consider answering it and accepting it as an answer to change its status to Answered. It will also help others to solve a similar issue. See can I answer my own question.., Just a reminder :)Concerning
Im sorry I just added the jdk path to the JAVA_HOME. I am still learning how to use Stack Overflow. Thank you for reminding me!Marquardt
M
2

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!

Marquardt answered 5/8, 2023 at 13:0 Comment(2)
In this process the JAVA_HOME contains the directory path of your JDK.Marquardt
i have same problem and i try this method that not solve the problem, any recommendation?Kiehl
E
4

In my case, the error appeared working with flutter extensions in VSCode. Configuring the JAVA_HOME variable in Windows doesn't solved the problem. But I installed "Extension Pack for Java" in VSCode and the problem disappeared.

Ellsworth answered 23/9 at 18:23 Comment(1)
this works for me. Thanks!!Elyssa
M
2

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!

Marquardt answered 5/8, 2023 at 13:0 Comment(2)
In this process the JAVA_HOME contains the directory path of your JDK.Marquardt
i have same problem and i try this method that not solve the problem, any recommendation?Kiehl
C
0

This is what worked for me.

I use Avast antivirus and it quarantined some of my openjdk java files (java.exe). I figured out it was a false positive and restored those files from quarantine.

It then resolved my "No connection to gradle server..."

Communion answered 29/8 at 20:37 Comment(1)
Same thing, and it was doing so silently w/o telling me. I went thru several uninstalls (deleting .vscode folder and roaming/Code folders, etc. and reinstalling, and finally found the files being quarantined. 2 days wasted until I saw this... thanks Jay for capturing this!!Molli
F
0

In the vscode, open the setting panel then search for java.home.

enter image description here

then search for the Java runtime folder in your machine, in my case, I use Mac, I start from the Library folder, then navigate until I see the Java folder /Library/Java/JavaVirtualMachines. here you will see all your Java runtime then change the path to a specific folder, in my case /Library/Java/JavaVirtualMachines/jdk-23.jdk/Contents/Home, then restart your vscode.

Note: at first I have only zulu-11.jdk but it does not work, so I install jdk-23.jdk.

Java Downloads: https://www.oracle.com/java/technologies/downloads/

enter image description here

Freedafreedman answered 9/10 at 5:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.