I want to find all the IP addresses of devices on the local network. I am currently connected to Java code. The useful Advanced IP Scanner utility is able to find various IP addresses in subnet 192.168.178/24 :

According to this answer, I built my code as follows:
import java.io.IOException; import java.net.InetAddress; public class IPScanner { public static void checkHosts(String subnet) throws IOException { int timeout = 100; for (int i = 1; i < 255; i++) { String host = subnet + "." + i; if (InetAddress.getByName(host).isReachable(timeout)) { System.out.println(host + " is reachable"); } } } public static void main(String[] arguments) throws IOException { checkHosts("192.168.178"); } }
Unfortunately, this does not print any results, which means that IP addresses are not available. What for? There are devices on my local network, for example, in Advanced IP Scanner scanning.
java networking network-scan
BullyWiiPlaza
source share