gradlew
im trying to turn my folder into a jar and my gradle is hard stuck on java 17 while i need java 21
108 Replies
⌛
This post has been reserved for your question.
Hey @wr! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./close
or theClose Post
button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
How are you running Gradle?
From the command line? Only your IDE?
What is your
JAVA_HOME
?
Do you have any toolchain configured in your build.gradle?im running gradle in cmd and idk what java_home is supposed to be / mean
What is the output of
echo %JAVA_HOME%
in cmd?
JAVA_HOME
is an environment variable that points to the Java installation if set up
Please also include the output of where java
and where javac
do i paste echo %JAVA_HOME% in cmd
yes
echo
is a command that just prints everything coming after itC:\Users\name>echo %JAVA_HOME%
%JAVA_HOME%
C:\Users\name>
this is what pops uip
this means no JAVA_HOME is set
look hold on one sec
What is the output of
where java
and where javac
?
and javac --version
where java
C:\Program Files\Eclipse Adoptium\jdk-21.0.8.9-hotspot\bin\java.exe
C:\Program Files (x86)\Common Files\Oracle\Java\java8path\java.exe
where javac
C:\Program Files\Eclipse Adoptium\jdk-21.0.8.9-hotspot\bin\javac.exe
javac 21.0.8
ok so how exactly do you see Gradle using the wrong Java version? Can you show your build.gradle file?
FAILURE: Build failed with an exception.
* What went wrong:
The supplied javaHome seems to be invalid. I cannot find the java executable. Tried location: C:\Program Files\Eclipse Adoptium\jdk-17.0.16.8-hotspot\bin\java.exe
* 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.PS C:\Users\anton\OneDrive\Desktop\meteor-wr-addon-1.21.4>
ok
There should be a program on Windows that you can use to edit environments
Can you try typing "environment" in your start menu? It should show something like "Edit user environment variables"
im there
now what
Add a new environment variable named
JAVA_HOME
and set the value to C:\Program Files\Eclipse Adoptium\jdk-21.0.8.9-hotspot
that should tell Gradle where to find Java
do i press enviroment variables
?
I think you didn't open the program I meant but yes, if you click on
Environment Variables...
you should get to it
How did you open that terminal?held down shit and right clicked in open space in the folder that has gradle
ok
and did .\gradlew.bat build in cmd
yeah that's all I wanted to know
you should be able to add the environment variable once you get to that menu
press new right and what do i do here


yes
variable name is and the value is
Actually can you show the contents of
JAVA_HOME
C:\Program Files\Eclipse Adoptium\jdk-17.0.16.8-hotspot
C:\Program Files\Eclipse Adoptium\jdk-17.0.16.8-hotspot
?
actually my fault
the value should be C:\Program Files\Eclipse Adoptium\jdk-21.0.8.9-hotspot
alr

looks good
now you should be able to close that cmd/PowerShell window, open it again and it should use JDK 21
FAILURE: Build failed with an exception.
* What went wrong:
The supplied javaHome seems to be invalid. I cannot find the java executable. Tried location: C:\Program Files\Eclipse Adoptium\jdk-17.0.16.8-hotspot\bin\java.exe
* 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.PS C:\Users\anton\OneDrive\Desktop\meteor-wr-addon-1.21.4>
Is that with a new cmd window?
yes
Can you try
echo %JAVA_HOME%
in cmd?C:\Program Files\Eclipse Adoptium\jdk-21.0.8.9-hotspot
Did you do that in the same cmd window as there?
wdym
Is that the window you executed the
echo %JAVA_HOME%
in?yea
Can you show the build.gradle file?
these all i got


then build.gradle.kts
This message has been formatted automatically. You can disable this using
/preferences
.Can you show the content of
C:\Program Files\Eclipse Adoptium\jdk-17.0.16.8-hotspot
?
ok so it seems you tried to uninstall that
Can you run
./gradlew --stop
in the project
and then try againyh
do i just open cmd
or cmd in the file thing
in the project
so there
PS C:\Users\anton\OneDrive\Desktop\meteor-wr-addon-1.21.4> ./gradlew --stop
Stopping Daemon(s)
1 Daemon stopped
PS C:\Users\anton\OneDrive\Desktop\meteor-wr-addon-1.21.4>
now try again
try what
gradle build?
yes
u the goat daniel
its downloading or wtv
❤️
Starting a Gradle Daemon, 1 stopped Daemon could not be reused, use --status for details
Calculating task graph as no cached configuration is available for tasks: build
Configure project :Fabric Loom: 1.11.4 <-------------> 0% CONFIGURING [21s]
IDLE IDLE root project IDLE IDLE IDLE
You were facing this problem essentially: https://discuss.gradle.org/t/gradle-is-trying-to-use-a-jdk-that-has-been-uninstalled-from-my-system/43202/9
Gradle Forums
Gradle is trying to use a JDK that has been uninstalled from my system
I had the same issue and I removed .gradle folder from user and it worked perfectly
You had a running Gradle daemon that was still referencing the old JDK
The
gradlew --stop
commands stops all running Gradle daemons
A daemon is a background process and Gradle uses daemons as an optimization as it can achieve better performance by using the same process for consecutive buildsbruh
BUILD FAILED in 1m 30s
3 actionable tasks: 3 executed
Configuration cache entry stored.
PS C:\Users\anton\OneDrive\Desktop\meteor-wr-addon-1.21.4>
Can you show the full build log/output?
ok seems there are compilation errors
y?
Your code is not valid Java code
These are errors in your Java code
Did you decompile that code?
jd-gui yea but i had permission from my friend who made the code
he just told me to decompile it
so your friend used an obfuscator which makes it hard to decompile/get useful stuff out of it
this resulted in one class being named
null
or it's just an anonymous class and the decompiler couldn't deal with it
null
is not a valid name of a Java class💔
what now
so you'd need to rename that class and the references to it
and in
wrESP2.java
, there's a syntax error where a "
is missing
it should probably be info("Deepslate at " + pos.method_23854(), new Object[0]);
is chatgpt correct on this

oh wow
yeah it's a pretty obvious error
cooked
alr give me a sec to fixx
the message literally tells you that the
"
is not closedwhich file is it in
cause i looked in wresp2.java didnt see it
nvm
i was in wrong one
info("Deepslate at" + pos.method_23854(), new Object[0]);
like this?
yeah should be fine
though you probably want a space between
at
and the closing "
alr
it would be the difference between
Deepslate at123
and Deepslate at 123
info("Deepslate at " + pos.method_23854(), new Object[0]);
wait
one sec
it didnt copy correct
info("Deepslate at " + pos.method_23854(), new Object[0]);
and I think the
, new Object[0]
is technically unnecessary (but not incorrect) if the method is using varargsno idea my friend js said to decompile his addon then copy and paste the coding and rebrand the meteor client addon for minecraft
i only know a littel about coding
but what other errors is there or was that it
idk what your decompiler did but it seems like your friend used an obfuscator making it difficult to decompile and make sense of the code
mainly the latter
what do i do now then
fix the errors I guess?
ok can u like pinpoint them for me
😭
like file - fix
chat gpt said
This message has been formatted automatically. You can disable this using
/preferences
.yes you'd need to change the
null
to something else there but I'm not 100% sure whether $1
is allowed there
you'll seealright
thanks for the help 🫡
If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.
ima be back if tho
if $1
dont work
sure

can i just do this file by file
Task :compileJava FAILEDC:\Users\anton\OneDrive\Desktop\meteor-wr-addon-1.21.4\src\main\java\wr\modules\StoneESP.java:64: error: unclosed string literal info("Stone at + pos.method_23854(), new Object[0]); ^ C:\Users\anton\OneDrive\Desktop\meteor-wr-addon-1.21.4\src\main\java\wr\modules\wrESP.java:84: error: unclosed string literal info("Rotated deepslate at + pos.method_23854(), new Object[0]); ^ C:\Users\anton\OneDrive\Desktop\meteor-wr-addon-1.21.4\src\main\java\wr\modules\wrESP2.java:183: error: unclosed string literal info("Deepslate at + pos.method_23854(), new Object[0]); ^ 3 errors [Incubating] Problems report is available at: file:///C:/Users/anton/OneDrive/Desktop/meteor-wr-addon-1.21.4/build/reports/problems/problems-report.html FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':compileJava'.
Compilation failed; see the compiler output below.C:\Users\anton\OneDrive\Desktop\meteor-wr-addon-1.21.4\src\main\java\wr\modules\StoneESP.java:64: error: unclosed string literal info("Stone at + pos.method_23854(), new Object[0]); ^ C:\Users\anton\OneDrive\Desktop\meteor-wr-addon-1.21.4\src\main\java\wr\modules\wrESP.java:84: error: unclosed string literal info("Rotated deepslate at + pos.method_23854(), new Object[0]); ^ C:\Users\anton\OneDrive\Desktop\meteor-wr-addon-1.21.4\src\main\java\wr\modules\wrESP2.java:183: error: unclosed string literal info("Deepslate at + pos.method_23854(), new Object[0]); ^ 3 errors * Try:
Check your code and dependencies to fix the compilation error(s) Run with --scan to get full insights.BUILD FAILED in 819ms 3 actionable tasks: 1 executed, 2 up-to-date Configuration cache entry reused. PS C:\Users\anton\OneDrive\Desktop\meteor-wr-addon-1.21.4> i fixed all of it and its still showing up wrong i fixed it all using notepad++
no
null is probably used in many other places
cooked
same issue with the missing
"
as it seems^
ah ok
what do i do now
look

Does it build successfully?
no
this is after i fixed everything
that still means you have the issues with the missing
"
in wrESP2
or
could it be this
"Rotated deepslate at "
shouldnt there be a space on both sides
yes
bruh
💔
i gotta do that for every file
Why did your friend hive you the binaries to decompile?
instead of giving you the actual code they use
cause he wants to be a gatekeeper and not just hand out the source code
💔
wait
daniel
my friend said its the mappings
everytime i edit the notepad++ stuff
should i
.\gradlew.bat clean
.\gradlew.bat build
i did taskkill /f /im java.exe
then .\gradlew.bat build
and this happened
Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reused, use --status for details
Calculating task graph as no cached configuration is available for tasks: build
Configure project :Fabric Loom: 1.11.4 :remapping sources
Task :compileJava FAILEDC:\Users\anton\OneDrive\Desktop\meteor-wr-addon-1.21.4\src\main\java\wr\addon\modules\StoneESP.java:64: error: unclosed string literal info("Stone at + pos.method_23854(), new Object[0]); ^ C:\Users\anton\OneDrive\Desktop\meteor-wr-addon-1.21.4\src\main\java\wr\addon\modules\wrESP.java:84: error: unclosed string literal info("Rotated deepslate at + pos.method_23854(), new Object[0]); ^ C:\Users\anton\OneDrive\Desktop\meteor-wr-addon-1.21.4\src\main\java\wr\addon\modules\wrESP2.java:183: error: unclosed string literal info("Deepslate at + pos.method_23854(), new Object[0]); ^ 3 errors [Incubating] Problems report is available at: file:///C:/Users/anton/OneDrive/Desktop/meteor-wr-addon-1.21.4/build/reports/problems/problems-report.html FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':compileJava'.
Compilation failed; see the compiler output below.C:\Users\anton\OneDrive\Desktop\meteor-wr-addon-1.21.4\src\main\java\wr\addon\modules\StoneESP.java:64: error: unclosed string literal info("Stone at + pos.method_23854(), new Object[0]); ^ C:\Users\anton\OneDrive\Desktop\meteor-wr-addon-1.21.4\src\main\java\wr\addon\modules\wrESP.java:84: error: unclosed string literal info("Rotated deepslate at + pos.method_23854(), new Object[0]); ^ C:\Users\anton\OneDrive\Desktop\meteor-wr-addon-1.21.4\src\main\java\wr\addon\modules\wrESP2.java:183: error: unclosed string literal info("Deepslate at + pos.method_23854(), new Object[0]); ^ 3 errors BUILD FAILED in 23s 3 actionable tasks: 3 executed
oh I didn't know you got access to them
well you still have the same issue with quotes
💤
Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping
.
Warning: abusing this will result in moderative actions taken against you.