By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,988 Members | 1,049 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,988 IT Pros & Developers. It's quick & easy.

Ethernet ID and system Info in Java

P: n/a
Hi,

I want to know if there is a way to get system level information using Java.
I am mostly interested in things like Ethernet ID and serial number of Hard
disk. Some of the values when you type "ipconfig /all" on windows.

I know we can do all this using JNI with the main routines written in C. But
is there a way to do it using Java alone?. I have not seen any API to help
me get such deep system level information.

Thanking you,
Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"Ashwini Kumar" <as***********@comcast.net> wrote in message news:<PZ********************@comcast.com>...
Hi,

I want to know if there is a way to get system level information using Java.
I am mostly interested in things like Ethernet ID and serial number of Hard
disk. Some of the values when you type "ipconfig /all" on windows.

I know we can do all this using JNI with the main routines written in C. But
is there a way to do it using Java alone?. I have not seen any API to help
me get such deep system level information.

Thanking you,


Call a C program or an assembly language program from Runtime#exec()
and read the result from Process#getInputStream().
Jul 17 '05 #2

P: n/a
"hiwa" wrote
"Ashwini Kumar" wrote
Hi,

I want to know if there is a way to get system level information using Java. I am mostly interested in things like Ethernet ID and serial number of Hard disk. Some of the values when you type "ipconfig /all" on windows.

I know we can do all this using JNI with the main routines written in C. But is there a way to do it using Java alone?. I have not seen any API to help me get such deep system level information.

Thanking you,


Call a C program or an assembly language program from Runtime#exec()
and read the result from Process#getInputStream().


IP address may vary if PC gets its IP from DHCP.

You can get the IP address fairly easily in Java (see InetAddress class) but
MAC address is not possible in Java (AFAIK).

There isn't a common Windows function in every version of Windows that gets
MAC address - there are actually many routines to get MAC address for
example; it depends on the version of Windows and what is installed. See
http://www.codeguru.com/network/GetMAC.html

I think the easiest way is to exec ipconfig (depending on how "professional"
it needs to look). MAC address can be modified (but not many people know
that).
See http://forum.java.sun.com/thread.jsp...1&thread=46369

You can get hard disk's volume serial number from executing "dir". However
they are not unique e.g. disk cloning (commonly done by Sys admins to
configure new PCs in commercial environments) will copy it.

Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.