How to print current ClassLoader with or without Spring
Now we explain how to print a class loader associated to current thread. We can use Spring, and with one row of code, we solve the problem! We use the ClassLoaderUtils class.
For example:
System.out.println(
org.springframework.util.ClassLoaderUtils
.showClassLoaderHierarchy(
Thread.currentThread().getContextClassLoader()));
If we don’t want to have any library dependency
