-3

I have a discord bot coded in Java and Gradle, and I need to find how to make it work. I ask the owner of the bot and he answers me : "./gradlew shadowJar" What does it mean? And what do I need to do make the bot work?

I already tried to compile the java file in jar, I tried to make a manifest but I couldn't make classes.

All I tried is:

javac Bot.java

-> Didn't work, error: package ch.qos.logback.classic does not exist

jar cvfm Bot.jar MANIFEST.MF server handlers commons commands audio

-> made a .jar file that doesn't do anything

jar tf Bot.jar

-> don't know what this does but there were no errors

java -jar Bot.jar

-> error: no main manifest attribute in bot.jar

It should make a jar file that makes the bot work but instead, it makes just errors or files that don't work.

Can someone help me to make this bot work?

Escartem
  • 37
  • 1
  • 6

1 Answers1

0

First of all you need to understand the difference between gradle and gradlew. See below the stackoverflow link. Difference between using gradlew and gradle. Besides, if you have the complete project along with gradle structure, go to command prompt pointing to your existing folder containing the project and run the following command.

gradlew clean build
Sambit
  • 7,625
  • 7
  • 34
  • 65
  • It didn't work, error: https://pastebin.com/raw/D4BBEg3u | it says that I need a JDK installation but JDK is installed on my computer. – Escartem May 12 '19 at 18:36
  • First check java home. Open cmd prompt and type java – Sambit May 12 '19 at 18:58
  • I set my JAVA_HOME to the correct path (JDK installation) and I also add it in PATH but it still doesn't work, but the error is different: ```Compilation failed; see the compiler error output for details.``` | but I actually don't know where is the compiler output. – Escartem May 12 '19 at 19:57
  • I found a logback.xml in the files, don't know if this can help: https://pastebin.com/raw/g7zALt8T – Escartem May 12 '19 at 20:05
  • logback.xml file has nothing to do with compilation. Are you able to build the project using the command which I provided ? – Sambit May 12 '19 at 20:06
  • if I type java in command prompt it says all the argument I can add with the command like java -cp – Escartem May 12 '19 at 20:08
  • type java -version – Sambit May 12 '19 at 20:09
  • it says: java version "1.8.0_211" Java(TM) SE Runtime Environment (build 1.8.0_211-b12) Java HotSpot(TM) 64-Bit Server VM (build 25.211-b12, mixed mode) – Escartem May 12 '19 at 20:10
  • Thats correct, go to the command prompt and point to your project directory and you can see a file like gradlew.bat and now execute the command gradlew clean build and check now. – Sambit May 12 '19 at 20:12
  • when I execute gralew.bat it shows some green text but it also closes instantly so I can't know what it says. There is also a build.sh file but it does the same thing ( close instantly ) – Escartem May 12 '19 at 20:19
  • How did you execute, just run the command gradlew clean build in command prompt only. – Sambit May 12 '19 at 20:21
  • It means there is some problem with the project which you downloaded or got. – Sambit May 12 '19 at 20:25
  • download link: https://github.com/Nekos-life/neko-bot-jda | if you could make this work it would be awesome. – Escartem May 12 '19 at 20:26