• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to find the Time of class loaded by jvm

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok I have been searching for this for weeks now.

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?


Thanks.
 
Bartender
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
reply
    Bookmark Topic Watch Topic
  • New Topic