1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-11-05 17:05:04 -05:00

JDK BUG: Desktop.browse() doesn't work in snap environment but xdg-open works just fine

This commit is contained in:
Reinhard Pointner 2018-06-21 03:41:48 +07:00
parent ab32d2feeb
commit f2051e835b

View File

@ -79,7 +79,13 @@ public final class SwingUI {
public static void openURI(String uri) {
try {
Desktop.getDesktop().browse(URI.create(uri));
if (Desktop.getDesktop().isSupported(Desktop.Action.BROWSE)) {
Desktop.getDesktop().browse(URI.create(uri));
} else {
// JDK BUG: Desktop.browse() doesn't work in snap environment but xdg-open works just fine
ProcessBuilder p = new ProcessBuilder("xdg-open", uri);
p.inheritIO().start();
}
} catch (Exception e) {
debug.log(Level.SEVERE, "Failed to open URI: " + uri, e);
}