• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1199
  • Last Modified:

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 ?

3 Solutions
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.

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.


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 SAssociate 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.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now