I created an eclipse plugin "my.example.plugin" which runs well. The plugin contains a class "MyClass" in some package "my.example.plugin.package".

Now my problem: I'd like to access/use "MyClass" from a regular java project in another Eclipse instance (which of course has "my.example.plugin" installed). I first thought everything I would need to do was adding "my.example.plugin.package" to the list of exported packages of "my.example.plugin". Unfortunately this doesn't work.

What I can do is converting the java project into a plugin project. In this case eclipse extends the classpath corresponding to "required plugins" as defined in the MANIFEST.MF file. Then I can select "my.example.plugin" as required plugin and use any exported packages. But I'd like to stay with a regular java project (don't want MANIFEST.MF, plugins.xml etc. files). Isn't there any equivalent mechanism to add jars of installed plugins to the classpath? Of course I could add it as "external jar" but this wouldn't be a nice solution at all!

in other words: I'd like to ship a java library together with my plugin.

> What I can do is converting the java project into a plugin project. In
> this case eclipse extends the classpath corresponding to "required
> plugins" as defined in the MANIFEST.MF file. Then I can select
> "my.example.plugin" as required plugin and use any exported packages.

That's indeed the cleanest approach

> But I'd like to stay with a regular java project (don't want
> MANIFEST.MF, plugins.xml etc. files). Isn't there any equivalent
> mechanism to add jars of installed plugins to the classpath? Of course I
> could add it as "external jar" but this wouldn't be a nice solution at all!

Your Java project should reference directly (in its classpath) the jar'd
plugin.
Beware that if you original plugin uses plugin.xml and other
Eclipse-specific stuff, it may not work correctly in a plain JVM out of
the Eclipse platform.