I\'m aware that this question has been asked before:
How to use URLClassLoader to load a *.class file?
However I don\'t really understand due to the lack of
Your _sHashFunctionFilePath
needs to have the package name of the target class removed from it, so the ClassLoader will look in _sHashFunctionFilePath
+ package.name
+ HashFunction.class
as the path to the file. If you don't do that, the ClassLoader won't be able to find the file.
So if the target class is my.great.HashFunction
in HashFunction.class
, then it needs to be in a directory called my/great/
if you want to use URLClassLoader. Then, you'd use /path/to
as the file:///
URL for your URLClassLoader if the .class file was actually found in /path/to/my/great/HashFunction.class
.