how can we get the list of all the classes that are currently loaded in the Java Virtual Machine(JVM)?? it'd be better without the use of any external libraries..thank you.
cool_zephyr 7 Junior Poster in Training
Recommended Answers
Jump to Posthow can we get the list of all the classes that are currently loaded
...
no I want to get a hold of the instance of the classSo is it version 1 or version 2? And if it's 2, how would you define "the instance of the …
Jump to PostBy "multiple instances" I mean something like:
Object a = new Thing(); // a is an instance of Thing Object b = new Other(); // b is an instance of Other Object c = new Other(); // c is an instance of Other
The JVM now …
Jump to PostOK. That's perfectly clear now, thanks.
I don't know of any API that does that, but the visualvm profiling tool that comes with the JDK does have tools to get a list of all the objects in the heap (eg see http://visualvm.java.net/heapdump.html …
Jump to Postmore thoughts...
if the target starts at boot time then it will be running in its own VM with its own heap/stack. Any other Java program you start later will also have its own VM/heap/stack - you don't get to start your program in someone else's already-running VM unless the …
Jump to Postit also sounds like a very dirty hack, bordering on trying to perform some sort of trojan attack.
AFAIK you indeed can't get a list of all class INSTANCES loaded by a JVM or ClassLoader, only a list of Classes loaded.
If you think it through logically, you can also …
All 17 Replies
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster
cool_zephyr 7 Junior Poster in Training
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster
cool_zephyr 7 Junior Poster in Training
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster
cool_zephyr 7 Junior Poster in Training
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster
somjit{} 60 Junior Poster in Training Featured Poster
cool_zephyr 7 Junior Poster in Training
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster
cool_zephyr 7 Junior Poster in Training
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster
jwenting 1,905 duckman Team Colleague
cool_zephyr 7 Junior Poster in Training
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.