Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how can know which class load #218

Closed
odd2008 opened this issue Apr 21, 2016 · 1 comment
Closed

how can know which class load #218

odd2008 opened this issue Apr 21, 2016 · 1 comment

Comments

@odd2008
Copy link

odd2008 commented Apr 21, 2016

eg:my Application has two jar:
com.github.test.Class1 in jar1

com.github.test.Class1 in jar2

how can i know which class load

i know can use this code:
ProtectionDomain pd = classForName(pcm).getProtectionDomain(); println( pd!=null?(pd.getCodeSource()!=null?pd.getCodeSource().getLocation():"CodeSource为空!"):"ProtectionDomain为空!");

will show classnotfoundexception

@jbachorik
Copy link
Collaborator

I might be missing something but this sounds as a generic JVM question - and more suitable for asking on eg. StackOverflow.

Anyway, try using '-verbose:class' JVM argument when starting your application - this will log all class load events with many details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants