【问题标题】:Java how to open url with command on Mac? [duplicate]Java如何在Mac上使用命令打开url? [复制]
【发布时间】:2016-12-09 19:15:25
【问题描述】:

我使用以下方法在 Windows 上的浏览​​器中打开一个 url:

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

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

我应该怎么做才能在 Mac 上达到同样的效果?

【问题讨论】:

    标签: java macos url command


    【解决方案1】:

    试试open

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

    希望对你有帮助

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-06-08
      • 1970-01-01
      • 2020-04-08
      • 2017-11-16
      • 2021-09-09
      相关资源
      最近更新 更多