Hey,
I know what you mean. But yes, I do that by asking the user to select the file via the JFileChooser, so I know the path to the file(s), but I left that part out of the code because it doesn't really help me solve the issue.
The main issue is that I can't seem to load a class if it's not in a directory tree which corresponds to the binary name.
Eg: The class "xxxx.yyyy.MyAlgorithm" can (only?) be loaded if the "MyAlgorithm.class" file resides in the yyyy folder, which in turn is in the xxxx folder. (If I'm correct?)
But I want to load that MyAlgorithm.class file if it's in the "zzzzz" folder, even though it's binary name is "xxxx.yyyy.MyAlgorithm". Is this possible?
PS: Finding out the binary name is no problem. I can use the ClassFileScanner or ask the user to create an XML file with the fullname or something. But it's the classloading itself that doesn't want to work unfortunaly

.
So to rephrase my question with another example:
Eg: The classfile MyAlg.class which has binary name: "xxxx.yyyy.MyAlg" is located in the directory "C:\users\ultddave\project\". How can I load it? Because it's not in a "xxxx/yyyy" directory tree like the binary name would suggest.
(Given you have the filepath to the .class file and you can find out it's binary name.)
Or is this impossible?
Kind regards.
Dave
Bookmarks