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
- Read an xml file – done
- Put those xml data in Navigator – done
- When user clicks on data in navigator, locate the class in a directory and try to load it – classnotfoundexception
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.
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
ClassLoaderthat can load a class from a directory (perhaps use theURLClassLoader). So you will need to create one of these and use it to load the class from the desired location.