I am trying to write a small program that will look up all the classes that have been loaded by JVMs.
I am using MonitoredHost and MonitoredVM to lookup all the classes/jars.
Is there a way I can find out what time the classes were loaded?
I don't know how to do this with code however if you just want to know which classes are loaded then use: java -verbose:class ClassFile
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
Hi Majid i am not sure on this but logically static variables are initialized when a class is loaded by the JVM. so if we try to initialize a static variable by system time it can be possible.. like this..
as i think it will initialize time variable very first at the time of class loading as it is static variable. so it should assign current time(class loading time). If there is any other good way then please post.
Yes I think Pankaj is correct. If you want to test this you can load the class dynamically (using Class.forName ) and print the value of the static variable.
Thanks and Regards,
Suhas
http://www.xplore-java.blogspot.com/