# HG changeset patch # User Jaroslav Tulach # Date 1289406360 -3600 # Node ID c366470a05e17dbeac5e7f769949342455dc7756 # Parent ba411f9d13e5ad472be141c1933785e088a3185c Try the Desktop and only if it fails fallback to xdg-open diff -r ba411f9d13e5 -r c366470a05e1 src/main/java/cz/xelfi/feedbook/Main.java --- a/src/main/java/cz/xelfi/feedbook/Main.java Wed Nov 10 08:53:58 2010 +0100 +++ b/src/main/java/cz/xelfi/feedbook/Main.java Wed Nov 10 17:26:00 2010 +0100 @@ -6,6 +6,7 @@ import com.sun.syndication.feed.rss.Channel; import com.sun.syndication.feed.rss.Item; import com.sun.syndication.io.WireFeedInput; +import java.awt.Desktop; import java.io.IOException; import java.net.URI; import java.net.URISyntaxException; @@ -23,8 +24,11 @@ final String token = login.auth_createToken(); URI u = new URI("http://www.facebook.com/login.php?api_key=" + APP_KEY + "&auth_token=" + token); System.out.println("authentication: " + u); - Runtime.getRuntime().exec("xdg-open " + u); - //Desktop.getDesktop().browse(u); + try { + Desktop.getDesktop().browse(u); + } catch (Exception ex) { + Runtime.getRuntime().exec("xdg-open " + u); + } System.out.println("Visit the browser and press enter..."); System.in.read();