Is it possible to load a class from a jar file and then create an object from it?
Note: The jar file is not there when the program is compiled, but is added by the user later and is loaded in when the user starts the program.
My code goes likes this: The user has a jar file with nothing but a compiled java class in it. The user then puts this jar file in a directory and starts my program which looks through the directory and finds this jar file. It then loads this jar file and creates a class from it which it then creates an object from that and adds it to an array.
I have everything down except for creating a class from the jar file (loaded as a java.io File) and then creating and object from that class.
Any help? Thanks.