Thus I ping hosts

import java.net.InetAddress;
 
public class Main {
  public static void main(String[] args) throws Exception {
    InetAddress address = InetAddress.getByName("194.145.63.12");
 
    boolean reachable = address.isReachable(5000);
 
    System.out.println("Is host reachable? " + reachable);
  }
}