This message was deleted.
# community-support
s
This message was deleted.
v
How did you "switch said Java"? The message seems pretty clear. You use Java 11 to run Gradle but need to run it with at least Java 17 to use that plugin in that version.
t
I mean't switching the Java version, sorry. I did that many times and it still gives me the same response
v
Yes, I got that. I asked you how. Because obviously you did not do it correctly, or the error would probably have gone.
You can also easily verify using
./gradlew --version
t
Oh, in IntelliJ you go to File > Project Structure and you can change the SDK (JDK) version there.
also, I did what you said to use the
./gradlew --version
and it said that the JVM is still Java 11 for some reason.
v
File > Project Structure and you can change the SDK (JDK)
That's irrelevant
The complaint is about the Java version you run Gradle with, that has nothing to do with the Java version you select for your project in IntelliJ. (Unless you configured to use the Project JDK which is not the default)
Go to the Gradle settings and select the Java version to run Gradle with there, then it works from IntelliJ
From commandline, you have to change your
JAVA_HOME
environment variable.
t
I went on google and searched up how to change the Gradle JVM version and it came up with this from the official IntelliJ website: 'In the Settings dialog ( Ctrl Alt 0S ), select Build, Execution, Deployment | Build Tools | Gradle. On the Gradle settings page, under the Gradle section, use the Gradle JVM option to check the Gradle version used for importing a project' But I don't see where it says 'use the Gradle JVM option' on the settings tab.
v
Not sure what you mean. That's exactly the setting I told you to set.
t
And thats the setting that I was going to change but its not anywhere to be seen on the settings tab
v
Which version is that?
For me looks like:
t
It says 8.2
oh wait it was the IntelliJ version wasn't it?
v
That would be maaaany years old
IntelliJ, not Gradle 😉
t
whoops, I think its the recent version since I did an update yesterday or 2 days ago I can't remember
2023.2 is what it says
v
I'm still on 2023.1.5, then I don't know where they moved it to, check the recent help?
Or wait, did you properly link the Gradle project actually? If you open the Gradle tool window, does it show your project? Because if I unlink a project it looks like
t
I don't think that there was a linked gradle project in the first place.
v
Well, that's probably your problem then
t
Nor, do I think I tried to in the first place.
v
If you don't have a Gradle project linked, my guess is, that it takes whatever is configured in the run configuration. And if the run configuration is created because you run a task first, I have no idea, maybe it takes the project jdk, maybe something else. I don't know because I always have my Gradle projects properly synced for much better IDE support.
t
Well, it is probably like this because I've never had to link a Gradle project before, especially in IntelliJ. The only uses I've had for this is just making minecraft mods, specifically fabric ones. Oh and I'm going through all of the Gradle articles from IntelliJ to see what I need to change in order for this to work.
v
Actually, usually it should automatically link the Gradle project when you open the project in the IDE 🤷‍♂️
t
When I go to edit configurations it even says that its a gradle project
v
Where?
t
On the project, I go to edit configurations and it pops up saying, "Gradle project: redstonetools-mod-1.18.2-2.0.0"
v
That's just a run configuration and tells you how the Gradle project you run is called
It does not mean it is properly linked to the IDE
t
But as soon as I go to Build Tools > Gradle, It's not there as a gradle project
this is so confusing
v
Right-click the settings script and select to link the project from the context menu
As I said usually it should be auto-linked when you open the project. No idea why it is not for you
That would be something to clarify with JetBrains
t
wait I think I did it
NOO it still says
JVM: 11.0.16.1
when i did
./gradlew --version
but hey now it says that its a gradle project, it seems that I went to the wrong thing. I went to the main menu settings, instead of File > Settings in the project
v
NOO it still says
JVM: 11.0.16.1
when i did
./gradlew --version
Of course it does
Why should changing IDE settings change how it behaves on the commandline? I told you above what you have to do additionally / alternatively for commandline above.
t
I meant to add that when I found the gradle project, I changed the Gradle JVM so thats why i said "NOO it still says
JVM: 11.0.16.1
when i did
./gradlew --version
"
v
You don't listen, do you?
Whatever you change within the IDE is pointless when you run Gradle from the commandline