It turned out that this question had been asked before.
2 Answers
use the Runtime exec command
Runtime.getRuntime().exec(new String[]{"ping","website"});
https://www.tutorialspoint.com/java/lang/runtime_exec_envp.htm
use the Runtime exec command
Runtime.getRuntime().exec(new String[]{"ping","website"});
https://www.tutorialspoint.com/java/lang/runtime_exec_envp.htm
HttpClientclass.