How do I retrieve a unique computer ID from java

R

Rick D.

Hi all,

I'm looking for a way to retrieve unique information from a specific
computer from a java application. Things like NIC/Mac number,
processor info or any information that can be used to make some kind
of computer ID. I've browsed the api documentation, and used google to
search but didn't find anything useful. Does anybody know if it can be
done or is it just not possible in java.

Any help would be greatly appreciated.

Best Regards,
Rick
 
F

frankgerlach22

Did you check the java.net package ?
Eg: stHostname=java.net.InetAddress.getLocalHost().getHostName();
gives you the hostname of the current machine. Compute a hash on the
hostname
if you need a number. Either use the hashCode() method or (more
sophisticated)
perform an MD5.
 
M

Michael Borgwardt

Did you check the java.net package ?
Eg: stHostname=java.net.InetAddress.getLocalHost().getHostName();
gives you the hostname of the current machine.

Hostnames are worthless as UID, even if you use getCanonicalHostName();
in dialup networks, hostnames are shifted around just as much as IP
addresses.
 
Y

Yakov Fain

Rick said:
Hi all,

I'm looking for a way to retrieve unique information from a specific
computer from a java application. Things like NIC/Mac number,
processor info or any information that can be used to make some kind
of computer ID. I've browsed the api documentation, and used google to
search but didn't find anything useful. Does anybody know if it can be
done or is it just not possible in java.

Any help would be greatly appreciated.

Best Regards,
Rick

Find a way to get it using a command from your computer's OS.
Then call this command from Java using Runtime.getRunTime().exec()
Regards,
Yakov Fain
 
T

Tom Dyess

Yakov Fain said:
Find a way to get it using a command from your computer's OS.
Then call this command from Java using Runtime.getRunTime().exec()
Regards,
Yakov Fain

I would shoot for the Nic's MAC address, or make a mixed key using several
identifiers such as mac+os+hostname.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top