In a previous article of this series we learned how to replace the default system class loader for any given class. This time we will show how to replace it even before running the main method, so that the entire program runs from start with a custom class loader.
To do it, you should change [...]
Java ClassLoader (4) – Loading a custom ClassLoader on JVM start
Java ClassLoader (3) – Namespaces
In this third part of series about Java ClassLoader we will show how class loaders interact with namespaces in Java, and how using class loaders it is possible to have two or more instances of a static field.
In the previous article we learned how to change a class’ class loader. Can we do anything interesting [...]
Java ClassLoader (2) – Write your own ClassLoader
This is the second part of series of articles about Java’s ClassLoader. We will show here how you can write your own simple ClassLoader and “replace” the default system ClassLoader with your version.
We have to extend the java.lang.ClassLoader class and implement some of its crucial methods, like loadClass(String name). This method is run every time [...]