Rob Prime wrote:In what folder are you when you're executing the JVM? It should be E:\URLClassLoaderTesting_TEMP\projects\project1. Also, you error tells me that the .class file does not think it belongs in the tests package; the fully qualified name in the .class file is ClassToBeLoaded, not tests.ClassToBeLoaded.
Have you perhaps created the .class file before you added the package statement?
Ah Hah! Thank you. It's been so many years since I've worked with java I'd completely forgotten about how it works at it's most fundamental levels.
My new code looks like this:
My output now looks like this, which is what I'm after:
Thank you so much Mr. Prime!