In order to find at runtime where from file system a class was loaded, following command would be useful:
Output will be something like this:
file:/C:/TestWorkSpace/lib/MyLibrary.jar
It can be helpful while debugging some class loading problems.
System.out.println(<myjavaclassname>
.class.getProtectionDomain()
.getCodeSource().getLocation());
Output will be something like this:
file:/C:/TestWorkSpace/lib/MyLibrary.jar
It can be helpful while debugging some class loading problems.
No comments:
Post a Comment