Access class files outside of a .jar
I have been doing research over the past few days and have so far been unable to find the answer to this question. I am trying to create a modular program where the main UI (core) of the system is included in an executable jar (no problems here).
The issue is that it needs to dynamically load modules that are added to a lib folder residing in the same directory as the jar when the program is executed (eventually going to turn the jar into a .exe w/ Launch4j). I have so far not been able to do this. It finds the classes just fine (determined by using print statements) but it will not load them into the UI. The file structure of the AP directory is as follows:
AP.jar (including the package 'core' with all UI components)
/lib (directory containing the *module.class files representing the modules)
It works as normal if I include the /lib package/directory in the .jar file, but that defeats the purpose of it being modular so that I can just add new modules to the /lib folder as necessary.
Has anyone ever done anything like this before? Ideas?
Thx in advance.