Let's say in our ClassA, we are calling a certain API from ClassB, and that API is not functioning as we expect. We are interested to see which jar file ClassB is loaded from. To do this add the following line to you code and inspect or print the value of the returned string.
String mysteriousPath = ClassA.class.getResource("ClassB.class").openConnection().getURL().toString();
String mysteriousPath = ClassA.class.getResource("ClassB.class").openConnection().getURL().toString();
No comments:
Post a Comment