nus-cs2103-AY2425S1 / forum

12 stars 0 forks source link

Gradle version incompatible with Java 17.0.11 #170

Closed vicelyav closed 1 month ago

vicelyav commented 2 months ago

Hi, I am in the process of setting-up gradle. However, I got an error message while loading it:

Your build is currently configured to use incompatible Java 17.0.11 and Gradle 6.2. Cannot sync the project.

We recommend upgrading to Gradle version 8.8.

The minimum compatible Gradle version is 7.2.

The maximum compatible Gradle JVM version is 13.

Possible solutions:

For context, I used my project directory "/Users/vicelyavisakha/Documents/CS2103/INDIVIDUAL PROJECT" as my gradle user home. The java version for my computer is Azul zulu 17.10.11. Any help would be appreciated. Thank you.

*Edit: I tested using another directory /Users/vicelyavisakha/.gradle as well and face the same issue

damithc commented 2 months ago

Hmm... did anybody else face this? @vicelyav Are you able to ignore this and proceed, for the time being?

vicelyav commented 2 months ago

@damithc i cannot proceed with the A-Graddle for now and potentially other graddle-related increments. I will try to do other increments first.

damithc commented 2 months ago

@vicelyav Can you share a screenshot of the error? When exactly did it appear?

vicelyav commented 2 months ago

This is the error message:

Screenshot 2024-09-02 at 1 26 34 AM

This is the settings window in IntelliJ:

Screenshot 2024-09-02 at 1 27 52 AM

I merged my master branch with the "add-gradle-support" branch, and then go to the settings to confirm my java sdk version. The error automatically happens after I exited the settings screen.

Incogdino commented 2 months ago

I believe you are using the wrong gradle version as suggested by the error message and the version here.

I have cloned your repo and changed the gradle version to version 7.6.2 and it is able to run gradle build with no issues.

The file changed is gradle-wrapper.properties in the wrapper directory within the gradle folder

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

Hopefully this solves your issue 😄

vicelyav commented 2 months ago

Ah I see, it really worked. Thank you so much!

It's interesting though, since I merged it from the forked branch. I am pretty sure my jdk version is correct as well. What's the likely cause of this discrepancy?

Incogdino commented 2 months ago

image

Hmm 🤔 Looking at sourcetree, could it be the case that you merged the commit instead of the branch? That could be the reason why the updated gradle version commit were not added when you merged them.

vicelyav commented 2 months ago

Ok thank you. I will figure it out.

yadobler commented 2 months ago

Just wanna add in, do try to put the error message in fenced codeblock. Makes things easier (and other forums might not be very nice about not doing it)

nus-se-bot commented 1 month ago

@vicelyav A gentle reminder to close this issue if the problem has been resolved. If not resolved yet, please post a comment explaining which part of the problem/question remains unresolved.

nus-se-bot commented 1 month ago

@vicelyav I'm closing this issue due to inactivity. Feel free to reopen if the issue is still unresolved.