I'm working on an application in which if a user clicks on a link, I want it to open in their default browser. From what I've read, this should in theory work, however, when run on Linux (specifically Linux Mint 17.1), it hangs until the program is force-quit. I'm not particularly interested in having it open in WebView. Any alternatives or fixes that you all can think of? Thanks in advance.
if(Desktop.isDesktopSupported()){
try{
Desktop.getDesktop().browse(new URI(url));
}catch (IOException | URISyntaxException e){
log.debug(e);
}
}
url
? Is it anhttp://..
orfile://..
or something else? – OffalDesktop.browse(..)
is known to fail forfile:
based URIs. UseDesktop.open(File)
instead. Does it also fail forhttp:
URIs? – Offal