2016-08-03 54 views
2

Ich benutze das folgende eine URL in einem Browser auf Windows zu öffnen:Java, wie man URL mit Befehl auf Mac öffnet?

Command="C:\\Program Files\\Internet Explorer\\IEXPLORE "+Url; 

Process Child=Runtime.getRuntime().exec(Command); 

Was soll ich tun das gleiche auf Mac zu erreichen?

Antwort

3

Versuchen Sie open.

String Command="open "+"http://google.ca"; 
Process Child=Runtime.getRuntime().exec(Command); 

this helps