Include Java project as library

后端 未结 9 1907
眼角桃花
眼角桃花 2021-02-10 13:48

I have three projects in my eclipse workspace:

EventKitchenCore
EventKitchenDesktop
EventKitchenAndroid

EventKitchenCore contains

9条回答
  •  广开言路
    2021-02-10 14:32

    This is the way i follow to add library to my projects

    Project with library

    PHASE 1: Creating Library Project

    Here on image you can see 2 projects named library and ListSamples which is using library

    To make the project library as a library project right click on the project and select properties

    Setting Library

    Mark IsLibrary check box to make it library

    you can see .jar file in bin folder of library project

    Compiled Libary

    Now the library project is created

    PHASE 2 : Adding Library Project to android Project

    Now Right click on your android project and select its property. then click on Add button inside library area and set the path of your library project to it

    enter image description here

    enter image description here

    Then a pop- will appear showing a list of library projects you have created in eclipse which is presently active (closed library projects will not shown)

    enter image description here

    Here i got only one project so it is listed here

    Select which all library you needed and click OK. Now the library projects will be added to your project

    enter image description here

    While checking your android project you can see the .jar file of your project is been added to your android project

    enter image description here

    NOTE :- If you are using android support package(android-support-v4.jar) in library project , There is no need to add it again in your Android Project .

    You can also use ant to add library to projects. But i don't have knowledge about that .

提交回复
热议问题