views:

231

answers:

1

I have developed an RCP plug-in (not standalone), and a Java Project with library code that the plug-in needs to call.

I have configured the Java Project in the same workspace. The plug-in has a project dependency on the Java Project.

The code compiles (the plug-in does some stuff with the Java Project / library code).

When I run the plug-in, I get a ClassNotFoundException:

java.lang.ClassNotFoundException: com.mycode.ArgSet
    at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:494)

Anyone know how to configure the plug-in properly?

+2  A: 

Convert your library project to a plug-in project (right-click -> Configure -> Convert to Plug-in Project) and add it to the dependencies of your plug-in project (manifest editor, Dependencies tab).

Fabian Steeg
thanks again Fabian! Do you know the reason for this? Is it to support versioning and so on?
geejay
Yes, support for different versions of a bundle is one reason that every bundle has its own class loader. You can find details about these things here: http://www.eclipsezone.com/articles/eclipse-vms/
Fabian Steeg
Does the new plug-in project need a Product Configuration as well? Im getting java.lang.RuntimeException: No application id has been found.
geejay
ok, fiddled around with the run configuration...fixed it
geejay