How to open Mozilla Firefox in windows with Java

1 Answer

0 votes
package javaapplication1;

public class JavaApplication1 {

    public static void main(String[] args) {

        try {

            ProcessBuilder p = new ProcessBuilder();

            p.command("C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe");
            p.start();

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

/*
             
run:


    
 */

 



answered Nov 27, 2016 by avibootz

Related questions

1 answer 261 views
1 answer 300 views
1 answer 311 views
1 answer 305 views
1 answer 371 views
1 answer 360 views
1 answer 242 views
242 views asked Nov 27, 2016 by avibootz
...