Ouvrir page html avec linux et mozilla

adakick Messages postés 68 Date d'inscription vendredi 21 janvier 2005 Statut Membre Dernière intervention 5 octobre 2009 - 28 sept. 2005 à 09:36
Twinuts Messages postés 5375 Date d'inscription dimanche 4 mai 2003 Statut Modérateur Dernière intervention 14 juin 2023 - 28 sept. 2005 à 11:16
Bonjour, j'aimerai pouvoir ouvrir une page html dans mon programme JAVA.

J'ai trouver des sources pour ouvrir sous windows, mais sa marche pas sous linux!

Merci d'avance.

1 réponse

Twinuts Messages postés 5375 Date d'inscription dimanche 4 mai 2003 Statut Modérateur Dernière intervention 14 juin 2023 111
28 sept. 2005 à 11:16
salut,



tu peux tjrs essayer un truc vite fait du genre:



Properties sys = System.getProperties();

String os = sys.getProperty("os.name");

Runtime r = Runtime.getRuntime();

try{

if (os.startWith("Linux"))

r.exec("mozilla www.google.fr/linux");

else if (os.endsWith("NT")||os.endsWith("2000")||os.endsWith("XP"))

r.exec("cmd /c start www.google.fr");

else

r.exec("start www.google.fr");

}catch (IOException e) {

System.err.println(e.getMessage());

}

WORA
0
Rejoignez-nous