Zitat von: Glod am 23 Januar 2023, 09:37:07Unterm Strich aber ziemlich belangloser Murks.
Zitat von: MxO2204 am 22 Januar 2023, 23:10:02Standard ist unter Debian ja Gnome
Desktop.getDesktop().browse(new URI(paramString));
public static final void launchBrowser(String paramString) throws IOException {
try {
if (isMac()) {
Class clazz = Class.forName("com.apple.mrj.MRJFileUtils");
Method method = clazz.getDeclaredMethod("openURL", new Class[] { String.class });
method.invoke(null, new Object[] { paramString });
} else if (isWindows()) {
Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + paramString);
} else {
String[] arrayOfString = { "firefox", "opera", "konqueror", "mozilla", "netscape" };
String str = null;
for (byte b = 0; b < arrayOfString.length && str == null; b++) {
if (Runtime.getRuntime().exec(new String[] { "which", arrayOfString[b] }).waitFor() == 0)
str = arrayOfString[b];
}
if (str == null)
throw new Exception("Could not find web browser.");
Runtime.getRuntime().exec(new String[] { str, paramString });
}
} catch (Exception exception) {
throw new IOException("Error attempting to launch web browser");
}
}
.. /usr/libexec/gnome-terminal-server
$ echo $XDG_CURRENT_DESKTOP
GNOME
Seite erstellt in 0.188 Sekunden mit 18 Abfragen.