Reputation: 2185
I have an eclipse rcp application. This application will try to load class files from a directory outside the application. However I always get an error of ClassNotFoundException. Do you have any ideas how class loading works in eclipse rcp?
Basically the use case is
I created a test java project and i added the external class library and it can locate those successfully. However if i intergrate it in eclipse rcp, it throws that error.
Upvotes: 2
Views: 1081
Reputation: 19443
Eclipse RCP applications use the OSGi class loading support to find the class loader associated with the OSGi bundles (plugins) in your application. If you want to load a class from somewhere, then you need to make a ClassLoader
that can load a class from a directory (perhaps use the URLClassLoader
). So you will need to create one of these and use it to load the class from the desired location.
Upvotes: 4