How to open URL with Mozilla Firefox in windows in Java

1 Answer

0 votes
package javaapplication1;

import java.util.ArrayList;

public class JavaApplication1 {

    public static void main(String[] args) {

        try {

            ProcessBuilder p = new ProcessBuilder();

            ArrayList<String> arr = new ArrayList<>();
            arr.add("C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe");
            arr.add("http://www.seek4info.com/");
            p.command(arr);
            p.start();

        } catch (Exception e) {
            System.out.print(e.toString());
        }
    }
}

/*
             
run:


    
 */

 



answered Nov 27, 2016 by avibootz

Related questions

1 answer 158 views
1 answer 173 views
1 answer 252 views
1 answer 208 views
1 answer 175 views
1 answer 178 views
1 answer 139 views
139 views asked Nov 27, 2016 by avibootz
...