code: private static String[] getOpenBrowserCommand(String url) throws IOException, InterruptedException {
          if (IS_WINDOWS) {
              return new String[]{"rundll32", "url.dll,FileProtocolHandler", url};
          } else if (IS_MAC) {
              return new String[]{"/usr/bin/open", url};
          } else if (IS_LINUX) {
              String[] browsers = {"google-chrome", "firefox", "opera", "konqueror", "epiphany", "mozilla", "netscape"};
              for (String browser : browsers) {
                  if (Runtime.getRuntime().exec(new String[]{"which", browser}).waitFor() == 0) {
                      return new String[]{browser, url};
                  }
              }
              throw new UnsupportedOperationException("Cannot find a browser");
          } else {
              throw new UnsupportedOperationException("Opening browser is not implemented for your OS (" + OS_NAME + ")");
          }
      }
docs: Returns the command to execute to open the specified URL, according to the
  current OS.
  
  @param url the url to open
  @return the command to execute to open the url with the default browser
  @throws java.io.IOException if an I/O exception occurred while locating the browser
  @throws InterruptedException if the thread is interrupted while locating the browser