Java Class.forName() from distant directory

前端 未结 3 1797
夕颜
夕颜 2020-12-01 22:29

I am currently loading Java classes using Class.forName() to load it.

clazz = Class.forName(\"interfaces.MyClass\");

But now I

3条回答
  •  南笙
    南笙 (楼主)
    2020-12-01 23:09

    You have to create an instance of ClassLoader which is aware of the directory with classes. See stackoverflow questions tagged urlclassloader.

提交回复
热议问题