How to import a jar in Eclipse

前端 未结 10 1404
挽巷
挽巷 2020-11-21 06:54

How do I import a jar in Eclipse?

10条回答
  •  野的像风
    2020-11-21 07:35

    Just a comment on importing jars into Eclipse (plug-in development) projects:

    In case you are developing Eclipse plug-ins, it makes sense to use Eclipse's native bundling mechanism instead of just importing the jar into a plug-in project. Eclipse (or better its underlying OSGi runtime, Equinox) uses so-called bundles which contain some more information than plain jars (e.g., version infos, dependencies to other bundles, exported packages; see the MANIFEST.MF file). Because of this information, OSGi bundles can be dynamically loaded/unloaded and there is automatic dependency resolution available in an OSGi/Eclipse runtime. Hence, using OSGi bundles instead of plain jars (contained inside another OSGi bundle) has some advantages.

    (BTW: Eclipse plug-ins are the same thing as OSGi bundles.)

    There is a good chance that somebody already bundled a certain (3rd party) library as an OSGi bundle. You might want to take a look at the following bundle repositories:

    • http://www.springsource.com/repository/app/
    • http://download.eclipse.org/tools/orbit/downloads/
    • http://www.osgi.org/Repository/HomePage

提交回复
热议问题