Re: get CPU info, RAM info
Roedy Green wrote:
On Thu, 8 Apr 2010 04:29:04 -0700 (PDT), ilya <bumsys@gmail.com>
wrote, quoted or indirectly quoted someone who said :
But if I want to know for all operation systems?
If you find a library that does what you want, the author may have
implemented it in JNI for several platforms.
There not much of such stuff in the standard classes. The Java ethic
is you should not know much about your platform. The code is supposed
to work on all platforms, not be tweaked to work.
The OS-specific parts of the JRE [1] are, of course, precisely stuff that's
been tweaked to work on all supported platforms. Unfortunately, Java
doesn't make it easy toi do this yourself, partly because JNI is difficult,
error-prone, and inefficient for passing large amounts of data, and partly
because Java gives you no help in packaging a collection of
platform-specific JNI libraries and finding the proper one at runtime.
1. E.g., file I/O, networking, threading, etc.