0

I probably don't know the right technical jargon to explain this but I'm trying to write a simple Java class with a reference to classes in a third-party project with Gradle dependencies such as:

import com.third.party.library.Class;

public class Main {
  public static void main(String[] args) {
    // some code
  }
}

where com.third.party.library.Class is a class from a third-party project with dependencies managed using Gradle. I have access to the code of the third-party project and its build.gradle file but I'm unsure of how to build that pipeline without using Gradle in my own code.

Can someone please give me hints on how to achieve this? Even clarity on my question can help.

intumwa
  • 334
  • 2
  • 4
  • 15
  • https://stackoverflow.com/questions/460364/how-to-use-classes-from-jar-files – SkywalkerLuke JS Dec 07 '21 at 15:45
  • 2
    Basically what you need to do is to add the third party project (and probably all its dependencies) to the classpath. Note that this can be a tedious task - this is among the reasons why build systems like gradle and maven exist. – Thomas Kläger Dec 07 '21 at 15:58
  • @Thomas Kläger thanks for the hint on the classpath. It's what I was looking for and it has worked. – intumwa Dec 07 '21 at 22:52

0 Answers0