我使用以下命令在 Windows 上的浏览器中打开 URL:
Command="C:\\Program Files\\Internet Explorer\\IEXPLORE "+Url;
Process Child=Runtime.getRuntime().exec(Command);
我应该怎样做才能在 Mac 上实现相同的效果?
最佳答案
尝试打开
。
String Command="open "+"http://google.ca";
Process Child=Runtime.getRuntime().exec(Command);
希望这有帮助
关于Java如何在Mac上用命令打开url?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38754219/