Print ClassNotFoundException
A simple problem that I have found many people struggling with – how to print class-path. Following is the line that can be used to print classpath.
Arrays.toString((((URLClassLoader) Test.class.getClassLoader().getURLs()));
This code returns an array list of all jars and directories on the classpath of the classloader.
- Sarang Anajwala
No comments:
Post a Comment