I have the following problem: I try to setup IntelliJ to use my local Gradle installation but when IDEA starts I get the following error message after importing my project:
Found invalid Gradle JVM configuration
gradle jar
works perfectly fine on the command line.
The workaround is to manually do the following:
- Find action -> Search -> Gradle -> Then select 'Gradle JVM:' option on the popup
- Override 'Use Gradle from:' and choose 'Specificed location' (In my case /home/jose/local/gradle/gradle-4.10.3)
- Override 'Gradle JVM:' and choose 'JAVA_HOME' (Shows up correctly as 'version 1.8.0_282')
- Click 'Apply' and 'OK'. Restart IntelliJ
But reading the documentation about the Gradle settings and Gradle JVM selection says than IntelliJ will honor the following settings for the gradle wrapper properties (default choice):
- JAVA_HOME (Defined to /opt/myjdkhome/1.8.0_282)
- GRADLE_USER_HOME (Defined to $HOME/.gradle)
- I'm using IntelliJ Idea Community Edition 2021.2.2
And more important, I do have the following overrides on the $HOME/.gradle/gradle.properties
org.gradle.jvmargs=-Xmx2024m -XX:MaxPermSize=512m
org.gradle.daemon=false
org.gradle.java.home=/opt/myjdkhome/1.8.0_282
systemProp.http.proxyHost=proxy.company.com
systemProp.http.proxyPort=8080
systemProp.http.nonProxyHosts=*.company.com
systemProp.https.proxyHost=proxy.company.com
systemProp.https.proxyPort=8080
systemProp.https.nonProxyHosts=*.company.com
systemProp.javax.net.ssl.keyStore=/etc/pki/ca-trust/extracted/java/cacerts
systemProp.javax.net.ssl.keyStorePassword=changeit
systemProp.javax.net.ssl.trustStore=/etc/pki/ca-trust/extracted/java/cacerts
systemProp.javax.net.ssl.trustStorePassword=XXXX
# systemProp.javax.net.debug=ssl:handshake
The gradle wrapper property file, gradle/wrapper/gradle-wrapper.properties (generated with gradle wrapper
) is pretty vanilla:
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Any ideas? I was thinking about dropping a XML partial configuration on $PROJECT_ROOT/.idea/gradle.xml but not sure if this will work. There is a way to override that for ALL the projects?
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="delegatedBuild" value="true" />
<option name="testRunner" value="GRADLE" />
<option name="distributionType" value="LOCAL" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleHome" value="$USER_HOME$/local/gradle/gradle-4.10.3" />
<option name="gradleJvm" value="#JAVA_HOME" />
<option name="modules">
</set>
</option>
</GradleProjectSettings>
</option>
</component>
</project>
Thanks,
CodePudding user response:
It looks like a known bug. Please follow for updates.