hardware information

In a java application I need to retrieve hardware information (cpu type and freq, hdd manufacturer, network interfaces, the like).

I know this is not possible using pure java, olny through JNI or some other trick.

Is there an existing API/JSR for this ? do I have to write my own dll ? is there a Java-only solution ? what's the easiest way ?

Who is Participating?
kawasConnect With a Mentor Commented:
Gets hardware information using javascript. I realize that you asked how to do it in java, but if you look at the javascript, they are using activeX.

if nothing else, you could embed activeX in your java app.
hapciuAuthor Commented:
how would i do that ? isn't there any other simpler solution ... ?
Hey Hapciu,

I would suggest you refer JRockit JVM (MBeans). Its the BEA JVM and it has management mbeans, which can retrieve the information you asked for.

Disadvantage is that, these management mbeans are specific to JRockit JVM and is not available in any other JVM mbeans.

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.


Try referring some of the mbeans there. Or you can use some of the mbean browser and view the appropriate MBean.
Mayank SAssociate Director - Product EngineeringCommented:
I would suggest using some JNI option which can be deployed on mutliple JVMs.
Good idea. However JNI is cumbersome and is very much similar to what JRockit offers. (It internally uses .dll or .so libraraies to get the details]
Mayank SConnect With a Mentor Associate Director - Product EngineeringCommented:
Yes internally it has to use JNI for this. But if management mbeans are specific to JRockit JVM, then its better to write your own. Try www.jniwrapper.com to abstract some JNI intricacies.
All Courses

From novice to tech pro — start learning today.