Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

Java lancement du browser par défaut

3 réponses
Avatar
yvon.thoravalNO-SPAM
je suis l'article suivant :

file:///Users/yvonthor/Desktop/java_exec_browser.html

ça marche bien en faisant :

MRJFileUtils.openURL(url);

mais c'est "deprecated"

une autre méthode est donnée sous "Follow-up Tip!" :
(Mark Weakly)

String[] commandLine = { "netscape", "http://www.javaworld.com/" };
Process process = Runtime.getRuntime().exec(commandLine);

j'ai essayé avec "Safari" à la place de "netscpae" mais ça ne lance
rien.

d'où la question, qu'est-ce qui remplace MRJFileUtils.openURL(url) ?
--
yt

3 réponses

Avatar
yvon.thoravalNO-SPAM
Yvon Thoraval wrote:

je suis l'article suivant :

file:///Users/yvonthor/Desktop/java_exec_browser.html


Oups, l'url correcte :

http://www.javaworld.com/javaworld/javatips/jw-javatip66.html

ça date, tout de même, du siècle dernier (1999)...
--
yt

Avatar
Mathias Terreaux
Yvon Thoraval wrote:
je suis l'article suivant :

file:///Users/yvonthor/Desktop/java_exec_browser.html

ça marche bien en faisant :

MRJFileUtils.openURL(url);

mais c'est "deprecated"

une autre méthode est donnée sous "Follow-up Tip!" :
(Mark Weakly)

String[] commandLine = { "netscape", "http://www.javaworld.com/" };
Process process = Runtime.getRuntime().exec(commandLine);



tu peux essayer
Runtime.getRuntime().exec("open 'http://...');


d'où la question, qu'est-ce qui remplace MRJFileUtils.openURL(url) ?


peut être ça :
http://developer.apple.com/documentation/Java/Reference/1.4.2/appledoc/api/com/apple/eio/FileManager.html

Avatar
yvon.thoravalNO-SPAM
Mathias Terreaux wrote:

tu peux essayer Runtime.getRuntime().exec("open 'http://...');


d'où la question, qu'est-ce qui remplace MRJFileUtils.openURL(url) ?



Impec, ça marche au poil...

peut être ça :
http://developer.apple.com/documentation/Java/Reference/1.4.2/appledoc/api
/com/apple/eio/FileManager.html


Intéressant pour les spécificités Apple.

Merci !!! -- yt