#gradlew

192 messages · Page 1 of 1 (latest)

thorny ferry
#

im trying to turn my folder into a jar and my gradle is hard stuck on java 17 while i need java 21

tall radishBOT
#

This post has been reserved for your question.

Hey @thorny ferry! Please use /close or the Close 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.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

manic tiger
#

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?

thorny ferry
#

im running gradle in cmd and idk what java_home is supposed to be / mean

manic tiger
#

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

thorny ferry
#

do i paste echo %JAVA_HOME% in cmd

manic tiger
#

echo is a command that just prints everything coming after it

thorny ferry
#

C:\Users\name>echo %JAVA_HOME%
%JAVA_HOME%

C:\Users\name>

#

this is what pops uip

manic tiger
thorny ferry
#

look hold on one sec

manic tiger
#

What is the output of where java and where javac?

#

and javac --version

thorny ferry
#

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

manic tiger
#

ok so how exactly do you see Gradle using the wrong Java version? Can you show your build.gradle file?

thorny ferry
#

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>

manic tiger
#

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"

thorny ferry
#

im there

#

now what

manic tiger
#

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

thorny ferry
#

do i press enviroment variables

#

?

manic tiger
#

I think you didn't open the program I meant but yes, if you click on Environment Variables... you should get to it

manic tiger
thorny ferry
manic tiger
#

ok

thorny ferry
#

and did .\gradlew.bat build in cmd

manic tiger
manic tiger
thorny ferry
#

press new right and what do i do here

manic tiger
#

yes

#

variable name is JAVA_HOME and the value is C:\Program Files\Eclipse Adoptium\jdk-17.0.16.8-hotspot

#

Actually can you show the contents of 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

thorny ferry
#

alr

manic tiger
#

looks good

manic tiger
thorny ferry
#

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>

manic tiger
#

Is that with a new cmd window?

thorny ferry
#

yes

manic tiger
#

Can you try echo %JAVA_HOME% in cmd?

thorny ferry
#

C:\Program Files\Eclipse Adoptium\jdk-21.0.8.9-hotspot

manic tiger
thorny ferry
#

wdym

manic tiger
thorny ferry
#

yea

manic tiger
#

Can you show the build.gradle file?

thorny ferry
#

these all i got

manic tiger
cinder ironBOT
#
plugins {
    id("fabric-loom") version "1.11-SNAPSHOT"
}

base {
    archivesName = properties["archives_base_name"] as String
    version = properties["mod_version"] as String
    group = properties["maven_group"] as String
}

repositories {
    maven {
        name = "meteor-maven"
        url = uri("https://maven.meteordev.org/releases")
    }
    maven {
        name = "meteor-maven-snapshots"
        url = uri("https://maven.meteordev.org/snapshots")
    }
}

dependencies {
    // Fabric
    minecraft("com.mojang:minecraft:${properties["minecraft_version"] as String}")
    mappings("net.fabricmc🧶${properties["yarn_mappings"] as String}:v2")
    modImplementation("net.fabricmc:fabric-loader:${properties["loader_version"] as String}")

    // Meteor
    modImplementation("meteordevelopment:meteor-client:${properties["minecraft_version"] as String}-SNAPSHOT")
}

tasks {
    processResources {
        val propertyMap = mapOf(
            "version" to project.version,
            "mc_version" to project.property("minecraft_version"),
        )

        inputs.properties(propertyMap)

        filteringCharset = "UTF-8"

        filesMatching("fabric.mod.json") {
            expand(propertyMap)
        }
    }

    jar {
        inputs.property("archivesName", project.base.archivesName.get())

        from("LICENSE") {
            rename { "${it}_${inputs.properties["archivesName"]}" }
        }
    }

    java {
        sourceCompatibility = JavaVersion.VERSION_21
        targetCompatibility = JavaVersion.VERSION_21
    }

    withType<JavaCompile> {
        options.encoding = "UTF-8"
        options.release = 21
        options.compilerArgs.add("-Xlint:deprecation")
        options.compilerArgs.add("-Xlint:unchecked")
    }
} ```

This message has been formatted automatically. You can disable this using /preferences.

manic tiger
#

Can you show the content of C:\Program Files\Eclipse Adoptium\jdk-17.0.16.8-hotspot?

thorny ferry
manic tiger
#

ok so it seems you tried to uninstall that

#

Can you run ./gradlew --stop in the project

#

and then try again

thorny ferry
#

do i just open cmd

#

or cmd in the file thing

manic tiger
#

in the project

thorny ferry
#

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>

manic tiger
#

now try again

thorny ferry
#

try what

#

gradle build?

manic tiger
#

yes

thorny ferry
#

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

manic tiger
#

You had a running Gradle daemon that was still referencing the old JDK

#

The gradlew --stop commands stops all running Gradle daemons

manic tiger
thorny ferry
#

bruh

#

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>

manic tiger
#

Can you show the full build log/output?

thorny ferry
manic tiger
#

ok seems there are compilation errors

thorny ferry
#

y?

manic tiger
#

Your code is not valid Java code

#

Did you decompile that code?

thorny ferry
#

jd-gui yea but i had permission from my friend who made the code

#

he just told me to decompile it

manic tiger
#

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

thorny ferry
#

💔

#

what now

manic tiger
#

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]);

thorny ferry
#

is chatgpt correct on this

#

oh wow

manic tiger
#

yeah it's a pretty obvious error

thorny ferry
#

cooked

#

alr give me a sec to fixx

manic tiger
#

the message literally tells you that the " is not closed

thorny ferry
#

which 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?

manic tiger
#

yeah should be fine

#

though you probably want a space between at and the closing "

thorny ferry
#

alr

manic tiger
#

it would be the difference between Deepslate at123 and Deepslate at 123

thorny ferry
#

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]);

manic tiger
#

and I think the , new Object[0] is technically unnecessary (but not incorrect) if the method is using varargs

thorny ferry
#

no 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

manic tiger
#

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

thorny ferry
#

what do i do now then

manic tiger
#

fix the errors I guess?

thorny ferry
#

ok can u like pinpoint them for me

#

😭

#

like file - fix

cinder ironBOT
#

chat gpt said ```java

class null {
to replace with
class StashFinder$1 extends TypeToken<List<StashFinder.Chunk>> {} ```

This message has been formatted automatically. You can disable this using /preferences.

manic tiger
#

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 see

thorny ferry
#

alright

#

thanks for the help 🫡

tall radishBOT
# thorny ferry 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.

thorny ferry
#

ima be back if tho

#

if $1

#

dont work

manic tiger
#

sure

thorny ferry
#

can i just do this file by file

#

Task :compileJava FAILED
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

[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++

manic tiger
#

null is probably used in many other places

thorny ferry
#

cooked

manic tiger
#

as it seems

thorny ferry
manic tiger
#

ah ok

thorny ferry
#

what do i do now

#

look

manic tiger
thorny ferry
#

no

thorny ferry
manic tiger
#

that still means you have the issues with the missing " in wrESP2

thorny ferry
#

or

#

could it be this

#

"Rotated deepslate at "

#

shouldnt there be a space on both sides

manic tiger
#

yes

thorny ferry
#

bruh

#

💔

#

i gotta do that for every file

manic tiger
#

Why did your friend hive you the binaries to decompile?

manic tiger
thorny ferry
#

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 FAILED
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

[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

manic tiger
manic tiger