Reputation:
I'm developing a Eclipse plugin. From this plugin I want to instantiate classes from another project that I have developed. I added this project to the build path, but nevertheless, I get the following error:
Caused by: java.lang.ClassNotFoundException: myPackage.myClass
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 38 more
I'm sure that I have to add the refernce to this project somewere else, but where? Any hints?
Upvotes: 2
Views: 1624
Reputation: 9928
You can create a dependent plugin (as Francis suggested), or add it as a library jar. Both methods are described here.
Upvotes: 1
Reputation: 19443
You should make your other project a plugin and then add it to your original plugin's manifest as a dependent plugin.
Upvotes: 1
Reputation: 7152
I had the same problem and solved it by adding a link to the other projects source folder as source folder to my project. However, I do not know whether this is the best possibility.
Upvotes: 1