Java’s “SystemClassLoader” can use to pint out the current project classpath , indirectly display the library dependency as well.

Example

package com.mkyong.io;
 
import java.net.URL;
import java.net.URLClassLoader;
 
public class App{
 
   public static void main (String args[]) {
 
        ClassLoader cl = ClassLoader.getSystemClassLoader();
 
        URL[] urls = ((URLClassLoader)cl).getURLs();
 
        for(URL url: urls){
        	System.out.println(url.getFile());
        }
 
   }
}

Output

/E:/workspace/HibernateExample/target/test-classes/
/E:/workspace/HibernateExample/target/classes/
/D:/maven/repo/antlr/antlr/2.7.7/antlr-2.7.7.jar
/D:/maven/repo/asm/asm/3.1/asm-3.1.jar
/D:/maven/repo/cglib/cglib/2.2/cglib-2.2.jar
...
Any Java questions or problems? please post at this JavaNullPointer.com forum, see you there ~