#Gradle build and wrapper fails

31 messages · Page 1 of 1 (latest)

astral fossil
#

Hello, I'm experiencing the following error when I try to compile my gradle project. Now I did some googeling and online everyone seems to agree that all you need to do to fix this is updating gradle using the wrapper. But when I try using the wrapper it fails with the exact same exception. How do I fix this?

./gradlew wrapper --gradle-version 9.7.1
WARNING: A restricted method in java.lang.System has been called
WARNING: java.lang.System::load has been called by net.rubygrapefruit.platform.internal.NativeLibraryLoader in an unnamed module (file:/C:/Users/lperw/.gradle/wrapper/dists/gradle-8.4-bin/1w5dpkrfk8irigvoxmyhowfim/gradle-8.4/lib/native-platform-0.22-milestone-25.jar)
WARNING: Use --enable-native-access=ALL-UNNAMED to avoid a warning for callers in this module
WARNING: Restricted methods will be blocked in a future release unless native access is enabled


FAILURE: Build failed with an exception.

* What went wrong:
25.0.4.1

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

BUILD FAILED in 662ms
delicate furnaceBOT
#

<@&987246399047479336> please have a look, thanks.

astral fossil
#

oh no i put the wrong tag ;-;

torpid sand
delicate furnaceBOT
#

Changed the category to Build Tools.

#

<@&987246554085740594> please have a look, thanks.

astral fossil
#

thanks 🥹

south mural
#

Is this minecraft related?

astral fossil
#

yes

#

it's a minecraft plugin with papermc

lyric zephyr
#

You could try moving or deleting that gradle-8.4-bin directory and re-running gradlew

astral fossil
#

it just creates the folder again and fails the build

#

at least if you mean .gradle/8.4

lyric zephyr
#

The path in your error message. I can't copy and paste on phone without great but I think we're talking about the same dir

astral fossil
#

yea, no

#

it literally immediately downloads 8.4 as soon as i run a gradlew task again

lyric zephyr
#

Maybe downgrade to java 21 re-run wrapper upgrade then upgrade to java 25 again

astral fossil
#

already tried that (well with java 20 cause i had that one installed)

#

didn't work

south mural
#

So your wrapper is out of date? I didn't see the exception that caused that build failure. Just warnings.

astral fossil
#

that's all it prints when try building

lyric zephyr
#

Oh yeah those are warnings. Add the --stacktrace option on

astral fossil
#

did --stacktrace and that somehow fixed it????

#

like the build worked with --stacktrace

#

thanks

#

it's fixed now

south mural
#

How about if you use the --stacktrace option it offers and find out what the issue is. Could be compatibility of jdk with gradle. Seems like gradle 8.4 is in there somewhere. You can also edit the wrapper explicitly in the gradle/wrapper/gradle-wrapper.properties THEN call just gradlew wrapper.

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

./gradlew --version to make sure it actually worked.

#

test