How to read all network cards with java

后端 未结 1 1519
醉酒成梦
醉酒成梦 2021-01-24 22:18

I want to lookup in my system (using java) for all network cards and network interfaces. So, more exactly, I want to get the whole output from ifconfig command (in

1条回答
  •  清酒与你
    2021-01-24 23:09

    You can use Runtime.getRuntime().exec("ipconfig") for Windows and Runtime.getRuntime().exec("ifconfig") for linux to get ifconfig result in java

    There is no way to get to the gory details here in 100% Java. You can either execute commands or write JNI.

    0 讨论(0)
提交回复
热议问题