Eclipse - Import your own library

Well, hopefully it's quick and easy.

I have two separate java projects, “Library” and “Project”, and I have a class in “Project” that wants to implement the method found in the “Library”. I'm looking for some kind of “import” call to make the “Project” class at the top of the class so that the methods found in the “Library” are available in this project.

How should I do it?

On the other hand, this project "Library" exists only because I want to use some of my own classes to complement the usual java libraries (java.util, java.io, etc.). Is there a way to add my java project to my java libraries? (i.e. import java.Library.className; ')

Thank,

Jonathan

+5
source share
2 answers

Just "Project" refers to your "Library", on the process windows (using the menu / tab names)

  • 1. Go to: Project → Properties → Java Build Path → Projects
  • 2. The client adds ...
  • 3. Select the "Library" project from the list
  • 4. Click OK.
  • 5. Click another.

Now you are done, and you can use the import for classes in your "Library"

+5
source

There are several ways:

. Import source files

  • Right-click your project in the project explorer.
  • select Properties → Java Build Path.
  • "" " " , , ""
  • "" "", "". "" .

. Jar   eclipse, "Build" . :

  • .
  • "" → Java.
  • "" " JAR". , Library.jar, "" ""

+4

All Articles