import java.awt.Desktop; import java.io.IOException; import java.net.URI; import java.net.URISyntaxException; public static void main(String args[]){ Desktop desktop = java.awt.Desktop.getDesktop(); try { //specify the protocol along with the URL URI oURL = new URI( "https://www.google.com"); desktop.browse(oURL); } catch (URISyntaxException e) { // TODO Auto-generated catch block e.printStackTrace(); } }