1
implementation ('lib/discord-rpc-release-v3.3.0.jar')
implementation ('lib/java-discord-rpc-2.0.2.jar')

I put this code into dependencies, but I think I'm doing it wrong. How could I do it correctly?

taylor.2317
  • 582
  • 1
  • 9
  • 23
Jethalal
  • 11
  • 1
  • I suggest you to use direct repo such as explained in [getting started](https://mcforge.readthedocs.io/en/latest/gettingstarted/). Also, there is french forum that talk about it [here](https://www.minecraftforgefrance.fr/topic/2475/utiliser-gradle-pour-g%C3%A9rer-les-d%C3%A9pendances) and [here](https://www.minecraftforgefrance.fr/topic/5698/aider-moi-j-arrive-pas-a-importer-le-forge-mdk-version-1-12-2-dans-mon-ide). – Elikill58 Oct 25 '21 at 13:18
  • 1
    Does this answer your question? [How to add local .jar file dependency to build.gradle file?](https://stackoverflow.com/questions/20700053/how-to-add-local-jar-file-dependency-to-build-gradle-file) – Elikill58 Oct 25 '21 at 13:20
  • I'm fairly certain local jar libs require a `files` as well. `implementation files('path/to/lib.jar') – Frontear Oct 25 '21 at 17:08

1 Answers1

0

If you wanna add local dependencies (meaning dependencies present in your computer), you have to use files with the implementation block. Do it like this:

dependencies {
  implementation files('lib/discord-rpc-release-v3.3.0.jar')
  implementation files('lib/java-discord-rpc-2.0.2.jar')
}

This way, gradle won't search for these dependencies in online repositories like Maven Central or any other, just make sure that the jars are present in the directory specified.

JustinW
  • 2,567
  • 1
  • 13
  • 29