So there's a lot of questions and examples around of reading external .class files using a ClassLoader but I'm struggling to see where I'm going wrong.
val folderUrl: URL = new File("D:/tmp/").toURI.toURL //file:/D:/tmp/
val cl: URLClassLoader = new URLClassLoader(Array(folderUrl), this.getClass.getClassLoader)
cl.loadClass("my.package.MyClassName")
The last line throws a ClassNotFoundException
The folder D:/tmp/ contains a class file "MyClassName.class". The class has the package "my.package" The class is called "MyClassName"
I can't understand what I'm doing wrong?
EDIT: The two closest question which relate are:
But these both do not have my problem however, they both get further than I have done where they successfully load the class before running into issues.