怎么样动态地找到当前类是从哪里装载到的?

打印 object.getClass().getResource("
/com/…/thisclassname.class").toString()  即可

如:jar:file:/H:/website/WEB-INF/lib/saaj-impl-1.3.2.jar!/com/sun/xml/messaging/saaj/soap/ver1_1/

Leave a Comment

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.