Search code examples
javagradlelibgdx

How to connect a library from a local disk to a LibGDX project in Java?


How to add a library to a LibGDX project?

The issue is that while connecting libraries from Maven Central and similar sources works fine, attempting to connect a library from a local directory in the project doesn't result in any errors, but also doesn't actually connect the library.

I've tried all possible variations of including "implementation files('libs/mylib.jar')" and similar options in the project's dependencies.

I could use a hack and simply add the library's source files to both the desktop and core projects, but I don't like that approach and would prefer to figure out how to properly connect the library.


Solution

  • The solution turned out to be very simple, you need to use not the local path to the library, but the full path.