You are correct in your assumption of needing to make a classloader.
This isn't as difficult as it sounds, and the API documentation at
http://java.sun.com/j2se/1.4.2/docs/api/ for the ClassLoader class it
very thorough in explaining how to implement one (I had to do this
myself a few months back).
Note that as far as I've been able to determine, this does NOT allow you
to load DLL files not within the OS's classpath (so JNI's are pretty
much out).
Tony Burrows wrote:
I need to be able to select a class when my app is running, then load it
and create an instance. I know this means I need some sort of class
loader but I'm getting lost.
Classes to be loaded can be anywhere in the directory tree but the classes
(usually) don't belong to a package. If they are in the same directory
that I start the app from, things work, otherwise they don't.
Any ideas, help or refs?
Tony