Import a zip file as a library - Eclipse Java

I immediately imported the google http library. I did some research on links such as:

The fact is that I imported correctly and worked correctly. But after a moment, he stopped working. I create one user library, import a zip file that contains the library, but this is not a sort of "compile library".

Take a look at the print, please: enter image description here

I try to solve four hours on my own, but I'm tired ... can someone help me?

Change one:

enter image description here

Change two:

enter image description here

+1
source share
2 answers

I did some more research and found this:

Then I followed these steps:

  • Extracted all google api content into one folder named lib
  • A new Librarby user window is created → Preference → Java → Build path → Create → Name your library → have not deleted the System library → Add external banks → manually added the necessary banks.
  • Right-click the project folder → Build Path → Configure Build Path → Libraries → Add Library → User Library → checked the created user library.

In conclusion: never import the library as a zip or you will have a long headache.

Hope this helps someone else.

Edit: in case of some error, for example, missing files belonging to the user library, cleaning up the project may be the solution. However, updating the project worked fine for me. Try pressing F5 or right-click on the project folder and select update.

+1
source

Right-click on your class that you want to use in the library in the left pane in eclipse. Choose Build Path => Customize Build Path.

Go to the Libraries tab

Click "Add External Banks"

Browse your file system for any .jar files (Java archives) that you want to include in your build path.

There you go .. now you can use archive classes in your code

0
source

All Articles