Dynamic class loading - Java

I am trying to create a program that will look for the specified directory for any other jar files (which I will not know the name). Then it will take an object from this file and create an instance that can be specified later in my program.

I am happy to do research on how to do this on my own, but I don’t know how it will be caused, even to start looking.

Can anyone point me in the right direction? Thanks

+4
source share
4 answers

I really found a link that has a great example, and that helped me get it to work the most. Find Here

+2
source

You need google up java reflection and read some articles / samples on it.

One good start would be the following:

+1
source

IO:

 File class 

Reading box:

 JarInputStream class 

Loading classes, instantiating and calling methods:

 ClassLoader class Class class Method class 
0
source

I encountered the problem of loading classes while working on a trading application and found the following link useful. http://trading.aurorasolutions.org/reflection-dynamically-loading-classes/

0
source

All Articles