I am trying to load class files from a folder so that way users can interact with my program. Users are supposed to be able to just extend the abstract class I made and drop it in the folder, but whenever I try and load a class (that I made, so I know its correct), it gives me an InstantiationException. Here is a stack trace snippet and a snippet of where the error is occuring
[9:09:22 PM] Jav: 23:03:40 [SEVERE] java.lang.InstantiationException: UchihaClan
23:03:40 [SEVERE] at java.lang.Class.newInstance0(Unknown Source)
23:03:40 [SEVERE] at java.lang.Class.newInstance(Unknown Source)
23:03:40 [SEVERE] at com.zavcoding.narutorpg.Classes.ClassLoader.load(ClassLoader.java:52)
23:03:40 [SEVERE] at com.zavcoding.narutorpg.NarutoRPG.onEnable(NarutoRPG.java:38)
Class<?> clazz = loader.loadClass(name);
Object object = clazz.newInstance();
if (!(object instanceof UserMadeClass)) {
System.out.println("Not a valid user class.");
continue;
}
UserMadeClass umc = (UserMadeClass) object;