Reputation: 2579
I am trying to create a program that will search a specified directory for any other jar files (which I will not know the name of). It will then take the object from that file and create an instance of it that can be referenced later in my program.
I am happy to do the research on how to do this on my own, but do not know what this would be called to even start looking.
Anyone able to point me in the correct direction? Thanks
Upvotes: 4
Views: 3460
Reputation: 1
I faced problem of loading classes while working on a trading application and found following link useful. http://trading.aurorasolutions.org/reflection-dynamically-loading-classes/
Upvotes: 0
Reputation: 2579
I actually found a link that has a great example in it that is what helped me get it working the most. Find it Here
Upvotes: 1
Reputation: 19220
You should google up java reflection
and read some articles / samples upon it.
One good start would be:
Upvotes: 1
Reputation: 18336
IO:
File class
Reading Jar:
JarInputStream class
Loading classes, creating instances and calling methods:
ClassLoader class
Class class
Method class
Upvotes: -1