When starting a new project I get the message unsupported JDK. Using Gradle 7.1. I want to update that default Gradle to 7.3-rc-1.
However, I just can't seem to find where to do this outside of a specific project. I am not sure where IntelliJ obtains it's Gradle version, and it has auto-updated in the past.
Sure I could update it afterwards, but as IntelliJ seems to break on trying to create folders and doesn't go back to do it once Gradle is updated. It would save a lot of headache for IntelliJ and myself to update or force it to use the version I want before the project creation.
https://i.stack.imgur.com/TLyxF.png
IntelliJ bundles version of Gradle much like it bundles a version of the JDK. In order to upgrade the bundled version of Gradle, you must update Intellij. However, there is no guarantee that an updated version of IntelliJ will come with an updated version of Gradle.
Related
I would like to change the Gradle version to 3.5.1 according to the project version received from git using this eclipse.
So I changed the editing path for the system environment variable, but if you enter 'gradle -v' in cmd, only 4.4 appears.
I looked for various solutions on the Internet, but it didn't work out.
How can I change the version?
And how can I erase the existing version 4.4 completely? I tried to erase it, but it kept popping up even if I deleted all the related files.
gradle -v:
One of the easiest way to change the gradle version is using sdkman. Install the required version you want and change whenever you want. Then hit
sdk install gradle <versionId>
sdk use gradle <versionId>
To check the list of versions installed
sdk list gradle
First, you need to know where Gradle is installed on your device. You can type where gradle in your terminal and the path will pop up.
Then, after you deleted the old version, go to the download page to download version 3.5.1. After download, follow the instructions in Installing manually in the Gradle installation guide.
Make sure that the old version is not included in your environment variables. If so, remove the old version and add the new one.
You can check Windows path variable by typing echo %PATH% in CMD.
Using Gradle Wrapper
To quote the manual:
If your existing Gradle-based build uses the Gradle Wrapper, you can easily upgrade by running the wrapper task, specifying the desired Gradle version:
./gradlew wrapper --gradle-version=7.4.2 --distribution-type=bin
I'm rather new to IntelliJ IDEA and Grails in general. I just started a new Project, selected my project JDK (11.0.1) and Gradle distribution (4.10.2). Whenever I try to run the project, I get this error:
Error initializing classpath: Could not determine java version from
'11.0.1'. java.lang.IllegalArgumentException: Could not determine java
version from '11.0.1'. at
org.gradle.api.JavaVersion.toVersion(JavaVersion.java:68) at
org.gradle.api.JavaVersion.current(JavaVersion.java:78) at
org.gradle.internal.jvm.UnsupportedJavaRuntimeException.assertUsingVersion(UnsupportedJavaRuntimeException.java:29)
at
org.gradle.tooling.internal.consumer.ConnectorServices.checkJavaVersion(ConnectorServices.java:66)
at
org.gradle.tooling.internal.consumer.ConnectorServices.close(ConnectorServices.java:53)
at
org.gradle.tooling.internal.consumer.DefaultGradleConnector.close(DefaultGradleConnector.java:57)
at
org.grails.cli.gradle.cache.CachedGradleOperation.call(CachedGradleOperation.groovy:78)
at
org.grails.cli.GrailsCli.populateContextLoader(GrailsCli.groovy:525)
at org.grails.cli.GrailsCli.initializeProfile(GrailsCli.groovy:508)
at
org.grails.cli.GrailsCli.initializeApplication(GrailsCli.groovy:306)
at org.grails.cli.GrailsCli.execute(GrailsCli.groovy:269) at
org.grails.cli.GrailsCli.main(GrailsCli.groovy:159)
All other discussions of the problem I found suggested changing the Gradle distribution, which I already did. I would be so happy if anybody could help me out here.
Cheers!
May be your java configuration is not correct. If not correct follow this steps.
Goto File-> Project Structure.
Change SDK
Or gradle version is not matching jdk 11 then skip this answer.
Besides the issue with Gradle above, if you're trying to run a Grails project I don't think you can do that with JDK higher than version 8.
Even the latest Grails (3.3.8 as of this writing) is still based on SpringBoot 1.5 which does not support newer JDK, I don't know if there's a special trick to make it work.
I had to delete the .gradle directory and restart Intellij.
I am getting some errors that had been fixed according to the 6.18 release notes and was hoping to bump the dependency version to fix the issue, but when I mvn install the project now, I get a build error
Classes found in the wrong directory: {META-INF/versions/9/com/teamdev/jxbrowser/chromium/swing/internal/AWTHelper$1.class=com.teamdev.jxbrowser.chromium.swing.internal.AWTHelper$1, META-INF/versions/9/com/teamdev/jxbrowser/chromium/swing/internal/NativeLinux.class=com.teamdev.jxbrowser.chromium.swing.internal.NativeLinux, META-INF/versions/9/com/teamdev/jxbrowser/chromium/javafx/internal/NativeMac.class=com.teamdev.jxbrowser.chromium.javafx.internal.NativeMac, META-INF/versions/9/com/teamdev/jxbrowser/chromium/javafx/internal/dialogs/ColorDialog.class=com.teamdev.jxbrowser.chromium.javafx.internal.dialogs.ColorDialog, META-INF/versions/9/com/teamdev/jxbrowser/chromium/internal/JavaVersion.class=com.teamdev.jxbrowser.chromium.internal.JavaVersion, META-INF/versions/9/com/teamdev/jxbrowser/chromium/swing/internal/AWTHelper.class=com.teamdev.jxbrowser.chromium.swing.internal.AWTHelper, META-INF/versions/9/com/teamdev/jxbrowser/chromium/swing/internal/Native.class=com.teamdev.jxbrowser.chromium.swing.internal.Native, META-INF/versions/9/com/teamdev/jxbrowser/chromium/internal/X509CertificateFactory.class=com.teamdev.jxbrowser.chromium.internal.X509CertificateFactory, META-INF/versions/9/com/teamdev/jxbrowser/chromium/swing/internal/AWTHelper$InstanceHolder.class=com.teamdev.jxbrowser.chromium.swing.internal.AWTHelper$InstanceHolder, META-INF/versions/9/com/teamdev/jxbrowser/chromium/javafx/internal/Native.class=com.teamdev.jxbrowser.chromium.javafx.internal.Native, META-INF/versions/9/com/teamdev/jxbrowser/chromium/internal/OS.class=com.teamdev.jxbrowser.chromium.internal.OS}
I have cleared my maven cache and tried versions 6.18-6.20 but I can only build with 6.17 and below. My license file claims to work for versions 6.X, so I would assume that is not the issue.
Thanks!
Starting from the version 6.18, JxBrowser provides multi-release jars, so it is able to work with both Java 8 and Java 9. And it seems that the maven used to build the application does not support the MR-JAR's, so it generates a build error. So you need to upgrade Maven version.
I am using Gradle with intellij.
I refresh Gradle and then I rebuild my project.
I get the following
Notice the first line - Using:javac 1.8.0_65
But I get the error that I should use -source7 or higher.
I also set the following at the settings
(With all of the inner modules are set to project sdk (1.8))
But I still can't rebuild or compile without this error.
Any suggestions?
(obviously i deleted all my classes and jars and then Gradle refreshed and rebuild project)
Same issue; got it solved with the following:
Go to: File / Settings / Build,Execution,Deployment / Build Tools /
Gradle / Gradle JVM
Then choose: Use JAVA_HOME
As of your second screen, make sure that all your modules are using the project default SDK, like in the screen below. The module setting may somehow be set to point older java version.
I had this problem while trying to build Android Studio. I kept getting
Tools need to be compiled with Java 1.8, you are using Java 11
Everything in the Intellij global and "Project Structure" settings was set to Java 1.8 so I couldn't figure out what was going on. For whatever reason, what ended up working was going to Build, Execution, Deployment > Build > Gradle and selecting the Amazon corretto version of Java 1.8 as installed by sdkman. This is baffling since I'd already tried selecting two other options for Gradle JVM that said 1.8 and both of those still resulted in the same error message as a result of Java 11 being used.
I finally resolved this issue for myself. I'm on Windows and it turns out the order in which the JDKs are listed in the Windows environment variable matter, and overrode what IDEA had set.
Although my project has JDK11 listed everywhere, JDK17 was still being used. I was able to finally resolve this issue by moving their ordering to list JDK11 first.
before I swapped the env var order
after (hurray!)
I have Spring Tool Suite 3.6.1, which is based on Eclipse 4.4.
I installed the version of Grails I need, but I noticed that the Groovy compiler is at 2.3, whereas I need it to be at 1.8.
I've gone to dist.springsource.org on the Eclipse Marketplace to look for the Compiler 1.8. I can install it, but it automatically uninstalls the existing Grails IDE. On top of that, it doesn't appear under Preferences - Groovy - Compiler and I don't seem to be able to select it.
What am I doing wrong? Do I need to use an earlier version of the Spring Tool Suite to access this particular compiler?
I'd recommend using the snapshot update site to get the latest groovy-eclipse: http://dist.springsource.org/snapshot/GRECLIPSE/e4.4/
That includes the 1.8 compiler and the latest groovy-eclipse 2.9.1 builds that work with it - the 2.9.0 release had trouble with groovy 1.8. (But 1.8 is getting quite old now so we may drop support in the not too distant future).
That snapshot build should also be compatible with grails-ide, not sure why it would be uninstalling grails-ide (but remember that grails-ide is different to the grails-runtime - have you definitely installed both from the dashboard extensions page or just the runtime?)