I have been trying to get the name or the ip of all computers on the network I am on in Java.
I have tried pinging for each one with 2 different ways:
Process p = java.lang.Runtime.getRuntime().exec("ping -n 1 " + host);
returnval = p.waitFor();
This returns 0 for every address even when it fails.
and
InetAddress.getByAddress(host).isReachable(timeout);
Always returning false
The computers appear in Windows network tab in explorer.
Is there some way to retrieve a list of names of those computer in Java to use?