1

I'm starting to write an application in Java that gets all the hard drive info, memory info, processor info, and prints it out. I was wondering if it was possible to also get all motherboard information. Like if there are any video cards, network cards, or sound cards connected and get their identifying information (brand, model etc.).

Basically, I want this program to tell you every component of your computer and give you the option to print it out.

How to get motherboard information?

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
dsta
  • 253
  • 1
  • 6
  • 15
  • 1
    Java is not the best language for this. In fact, since most of it would require OS specific native code, it might be more accurate to say that "Java can't do it". – Andrew Thompson Jan 25 '12 at 03:48
  • 1
    you will probably need to make a JNI call. It wouldn't be that difficult if you know the platform and deployment. http://stackoverflow.com/questions/123575/how-to-get-the-temperature-of-motherboard-of-a-pc-and-other-hardware-statistics – Daniel B. Chapman Jan 25 '12 at 03:53
  • I edited your post to better reflect the information required. You might glean the information revealed by source on [this post](http://stackoverflow.com/a/7616206/418556) to get part of the information. – Andrew Thompson Jan 25 '12 at 04:00
  • @Daniel Well, I just actually started learning Java about a week ago lol, but I'll give it a shot. – dsta Jan 25 '12 at 04:00
  • @DarthVader Yea I was just looking into that. I would like to write it in Java though, since it is more portable. I would also like to start learning the JNI, but I'm starting to wonder if this program is possible for me to write in Java. – dsta Jan 25 '12 at 04:36
  • u dont need portability when you have windows. – DarthVader Jan 25 '12 at 04:44
  • true lol but I also have a mac that I want to try it out on. – dsta Jan 25 '12 at 04:51
  • @dsta you need a fair amount of C knowledge to really utilize the JNI in a productive manner. If you're just playing around with it Java definitely isn't the best language (by a long shot) for this problem. Is it possible? Absolutely. Is it smart? Definitely up for debate. – Daniel B. Chapman Jan 25 '12 at 22:29

2 Answers2

1

To be honest, since that is a low-level functionality, I doubt that Java is suited for things like that.

Anyhow, you could run other programs on Linux to check for that, things like dmidecode, etc. or reading the /proc pseudo filesystem.

I don't know if it is really helping, but here's a web page, that describes that kind of functionality under Windows.

polemon
  • 4,722
  • 3
  • 37
  • 48
0

if your application is targeted for Windows, you could try using Java Native Access. Here is a tutorial. it is a kind of a bridge to system native libraries that omits JNI dirty stuff. if you can indetify Windows libraries and their callbacks for information you need, I think you should be able to call them via JNA. similar should be also possible on Linux.

mantrid
  • 2,830
  • 21
  • 18