aspose file tools*
The moose likes Java in General and the fly likes How to Get the  CPUs/Processors System Usage in java ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "How to Get the  CPUs/Processors System Usage in java ?" Watch "How to Get the  CPUs/Processors System Usage in java ?" New topic
Author

How to Get the CPUs/Processors System Usage in java ?

Rohit Kumar Gupta
Greenhorn

Joined: Apr 09, 2009
Posts: 3
hi to everyone

am totally new to this community.... so might be posting this on wrong forum..no ideas

as one of my projects i have to calculate the CPU utilization of the computer
in java there is API to calculate CPU utilization in Linux.....but dey dont work in Windows
there is possibility that i dont have proper information...so want to know from you people if there is some way to get such info in Windows....and if there is then i would be really thankful if you people guide me through it.

thanks in advance

Dawn Charangat
Ranch Hand

Joined: Apr 26, 2007
Posts: 249
There is no API which will help you get this directly in windows. You will have to write that in any other language, and may be invoke it in Java using JNI.
Else, you can go the JMX way.... try getting the info from JConsole.
Rohit Kumar Gupta
Greenhorn

Joined: Apr 09, 2009
Posts: 3
thanks Dawn for the reply and clearing my doubt
i got some program in .Net for getting it, an will use JNI to get the info.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to Get the CPUs/Processors System Usage in java ?