Reputation: 21
I am following this tutorial about building Java web applications in VSCode.
After I pressed F5 to debug my code, I received the error message Could not install Gradle distribution from 'https://services.gradle.org/distributions/gradle-4.6-bin.zip'.
.
Screenshot:
Can anyone help me figure out why this error message is appearing?
Upvotes: 2
Views: 7700
Reputation: 892
If you want to download Gradle manually and use that you can configure some VS Code settings to reference your Gradle distribution:
Thanks to https://github.com/microsoft/vscode-gradle/issues/1125#issuecomment-996441654
Upvotes: 1
Reputation: 300
I encounter the same problem on Linux.
My understanding is that VS Code wants to use the directory /usr/share/java/gradle/
(which is contained in the environment variable GRADLE_HOME
), whereas it should use ~/.gradle
instead.
I tried to fix it through the configuration files (such as gradle-wrapper.properties
, .vscode/settings.json
or .settings/org.eclipse.buildship.core.prefs
) but without success.
The only workaround I found was to set the environment variable:
~/.bash_profile
and reboot:export GRADLE_HOME=~/.gradle
env GRADLE_HOME=~/.gradle code
If you use a desktop entry, customize the relevant file. In my case (Arch Linux), this file is /usr/share/applications/visual-studio-code.desktop
; so put the following line into it:
Exec=env GRADLE_HOME=~/.gradle code %f
and restart VS Code (twice if necessary).
I opened an issue on Github.
Upvotes: 2