Open URL On Web Browser With JAVA (Linux, Mac, Windows)

By | August 23, 2018

If you need to open link on browser with java code, you can do with this code.

Runtime rt = Runtime.getRuntime();
String url =
    "https://www.cimblo.com“;
try {
  rt.exec("open " + url);
} catch (IOException e) {
  e.printStackTrace();
}

Open URL On Web Browser With JAVA (Linux, Mac, Windows)

Open URL On Web Browser With JAVA (Linux, Mac, Windows)

That code currently will work on Linux, Mac, Ubuntu and Windows in any default browser. See another java article here.

Leave a Reply

Your email address will not be published. Required fields are marked *