title: How do I open a link directly onto a web browser
body: <p>I'm experimenting with opening a link directly on to a web browser. This snippet of code has no errors. However, when run, the website does not pop up in the web browser. How do I fix this?</p>
  
  <pre><code>    if (str1.toLowerCase().contains("will pigs fly"))
          pigs();
  
  
      public static void pigs(){
          try{
  
              String url = "https://www.youtube.com/watch?v=YQo0TfuueaY";
              String cmd = "cmd.exe /c start " + url;
              Runtime.getRuntime().exec(cmd);
  
          }catch(Exception ex){}
  
      }
  </code></pre>