how to find the hardware ID like, Harddisk serial number, processor serial number, motherboard serial number, etc. in java?
Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
how to find the hardware ID like, Harddisk serial number, processor serial number, motherboard serial number, etc. in java?
Unfortunately, that's not possible in pure Java. You can look into JNI, though.
Not sure but SIGAR might offer something.
Sigar API
// Json
i will be helpful if i have code snippet.coz i am new to java. thank u in advance.
I wouldn't recommend doing JNI stuff if you are new to Java, unless you are coming from a C/C++ background.
// Json
It's my standard answer to anything that can't be done in pure Java. Why do you want to know the serial number of your harddisk and such? It's much easier to try and find that on the hardware itself (particularly the mother board).
actually i am doing a project to attach hardware IDs with email. so that we can easily track the email. it will have uses in some other fields also.
How many of these things do you have to look up? It may be easier to manually look them up and store those codes with some key-file on your computer (say like putting a serials.cfg file somewhere on that computer). This way, your program only will have to handle file reading, a much easier task.
FYI: I think that windows machines generate their own serial codes for hard disks that may or may not be the same as the manufacturer's serial codes. This is because of the way window's drivers work, and each partition of a single hard-drive produces a separate serial code.