|
Re: Load a class of a fragment dynamically from a String [message #499437 is a reply to message #499431] |
Sun, 22 November 2009 15:26 |
Wim Jongman Messages: 423 Registered: July 2009 |
Senior Member |
|
|
Hi Michelle,
You have to export the package that delivers the class and import the package
in the plug-in that does the reflection (uses forname method). Instead of
Require-Bundle you use Import-Package.
here is a fragment from the MANIFEST.MF
Require-Bundle: org.eclipse.ui;bundle-version="3.4.1",
org.eclipse.core.runtime;bundle-version="3.4.0",
Import-Package: org.apache.james.mime4j;version="0.6.0",
org.apache.james.mime4j.codec;version="0.6.0",
Best Regards,
Wim Jongman
> Hello,
>
> is there a chance to load a class with a String which consists the name of
the package and the name of the class. But not the name of the plugin, which
consists the class. But the plugin is loaded and activ.
>
> I tried it with thw following code. But I get a ClassNotFoundException.
>
>
> String className = aaa.test.TestClass;
> Class <?> testClass = Class.forName(className);
>
> What can I do, to get a instance of this class.
|
|
|
|
Powered by
FUDForum. Page generated in 0.03879 seconds