1

I need to use a library (JDOM) in my program, but I can't figure out how to use it without eclipse (I know on eclipse it is "build path" or something like that).

Can anyone help me please ?

Thanks

Elodie G.
  • 49
  • 7

1 Answers1

1

You do not install java libraries.

In the end, a Java library is nothing but one (or more) JAR archives that sit on your file system. Thus, "installing" boils down to:

  • identify the JARs to download
  • download them
  • put them in a known space in your file system

Then, when compiling/running a Java application that is supposed to use these libraries, you have to ensure that your classpath setup points to the correct JARs.

Typically, you want to use a Java library as part of one of your projects (a library does nothing for you, it needs to be used by a program to be useful). So the normal approach is that you have a project directory somewhere, and in there, you might have a libs subdirectory for example.

But I guess the real answer here is: learn about build system such as maven or gradle. These tools help you building java applications, and they also give you a "model" how to structure your java projects. And they take care of downloading libraries and such things, too.

GhostCat
  • 137,827
  • 25
  • 176
  • 248
  • Ok, so where am I supposed to put the file (what is the known space, is it in the jdk, or..? (sorry I am such a beginner). – Elodie G. Oct 18 '18 at 16:46