I'm using Eclipse in Windows 7, 64-bit. I have some pretty standard code that does this:
BufferedInputStream bi;
try {
// WINDOWS VERSION
if (System.getProperty("os.name", "Windows").startsWith("Windows")) {
bi = new BufferedInputStream(Runtime.getRuntime().exec("ipc onfig -all").getInputStream());
bi.read(buff);
String ipConfig = new String(buff);
....etc. (I go into the String and get the "Physical Address" strings.)
When I step through this code line-by-line in debug mode, it works fine and gets the Mac address.
When I run it in non-debug mode (i.e., without stepping through) it only manages to get these first two lines of the complete ipconfig:
Windows IP Configuration
Host Name . . . . . . . . . . . . : Robo
So, I can't get my machine's Mac address with this code. It's very strange. Why does the code work when stepping through but not in a regular run?
Can anyone give me any help?