| Java, Eclipse and Web programming Tutorials |
Version 0.2
Copyright © 2009 Lars Vogel
17.10.2009
| Revision History | ||
|---|---|---|
| Revision 0.1 | 26.07.2009 | Lars Vogel |
| Separated from http://www.vogella.de/articles/RichClientPlatform/article.html | ||
| Revision 0.2 | 17.10.2009 | Lars Vogel |
| Minor rework | ||
Table of Contents
In Eclipse RCP and Eclipse plugin development you work with Eclipse bundles or OSGi bundles .
This article describes how to convert standard Java libraries delivered as jars to Eclipse plugins / OSGi bundles.
Java bundles packages into jars. Eclipse RCP requires that these jars are bundled into plugin project. The following will describes how to integrated these jars into an Eclipse RCP product.
You create a plugin project for these jars and and add this plugin as dependency to your Eclipse RCP application / product.
Create a new Plugin project by selection File-> New -> Project...-> Plug-in Development -> Plug-in from existing JAR archives

Add the jars you want to have in this new plugin. Press next.

Maintain a name and a version for this plugin. Uncheck the flag "Unzip the JAR archive into the project". Press then finish.

You have now bundled your jars into a new plugin. Check the MANIFEST.MF on the tab runtime. All the packages from your jars should be included in the exported packages as your Eclipse RCP application will access these packages.
In the plugin project in which you want to use the libraries you can now select your plugin.xml and the tab dependencies. Under required Plug-ins press add and add your generated plugin as a dependency to your RCP application. This will make the classes from the jar available to your plugin.

Thank you for practicing with this tutorial.
Please note that I maintain this website in my private time. If you like the information I'm providing please help me by donating.For questions and discussion around this article please use the www.vogella.de Google Group. Also if you note an error in this article please post the error and if possible the correction to the Group.
I believe the following is a very good guideline for asking questions in general and also for the Google group How To Ask Questions The Smart Way.
http://www.vogella.de/code/codeeclipse.html Source Code of Examples