Classloader issues - How to determine which library versions (jar-files) are loaded

前端 未结 5 1180
予麋鹿
予麋鹿 2020-12-13 18:57

I\'ve just solved another *I-though-I-was-using-this-version-of-a-library-but-apparently-my-app-server-has-already-loaded-an-older-version-of-this-library-*issue (sigh).

5条回答
  •  眼角桃花
    2020-12-13 19:49

    If you happen to be using JBoss, there is an MBean (the class loader repository iirc) where you can ask for all classloaders that have loaded a certain class.

    If all else fails, there's always 'java -verbose:class' which will print the location of the jar for every class file that is being loaded.

提交回复
热议问题