Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [equinox-dev] (no subject)

Hi!

You could do: "Activator.class.getClassLoader()" (assuming that Activator is a class of the bundle you are looking for, so this makes most sense from within the bundle)

But anyway, in OSGi you shouldn't try (and you don't need in most cases) to interact with the classloaders directly. The BundleContext gives you methods to load classes and resources from a bundle (if you wanna do this manually). But in many cases you don't even need that - but it depends, of course, on your usecase.

HTH,
Martin




         could you please tell me how can I get the ClassLoader of the
current bundle?It seems the
Activator.bundleContext.getClass().getClassLoader() can't work.
      Looking forward your reply,Thanks.



_______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/equinox-dev


Back to the top