Tutorial :Is there a way to load classes jars and packages on run time?



Question:

I want to know if there is a way to load classes and jars on runtime?


Solution:1

Absolutely - create an appropriate ClassLoader instance, e.g. using URLClassLoader. You can then ask that classloader to load classes etc.

If you can give more information about exactly what you're trying to do, we can possibly help to provide more details or sample code.


Solution:2

Ya you can do it using Custom class loader. And this is what is used for Hot Deployment, That is loading classes at runtime.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »