Free tutorials for Java, Eclipse and Web programming



Follow me on twitter

How to create Eclipse plugins from jars

Lars Vogel

Version 0.3

07.06.2010

Revision History
Revision 0.126.07.2009Lars Vogel
Separated from http://www.vogella.de/articles/RichClientPlatform/article.html
Revision 0.217.10.2009Lars Vogel
Minor rework
Revision 0.307.06.2010Lars Vogel
Update to Eclipse 3.6 (Helios)

Converting jars to Eclipse plugins

This article describes how to create Eclipse plugins (OSGi bundles) from standard Java libraries delivered as jars. This article is based on Eclipse 3.6 (Helios).


Table of Contents

1. Overview
2. Integrating external jars / third party libraries
2.1. Create a plugin project for your jar
2.2. Using the new plugin project
3. Thank you
4. Questions and Discussion
5. Links and Literature
5.1. Source Code
5.2. vogella Resources

1. Overview

The standard deployment format for Java is a .jar file. A jar file is a zip file which contains the necessary resources to use the Java libraries, e.g. the class files.

In Eclipse RCP and Eclipse plugin development you work with Eclipse bundles or OSGi bundles . If you want to use standard Java libraries (jars) in this environment you have to convert them to a plugin. After creating a new plugin project, you have to export the necessary packages for these jars and and add the new plugin as a dependency to the plugin which is using the functionality provided by the new plugin.

If you repackage a jars into a plugin it is wise to check if the license allows this.