How to open text file in windows notepad with Java

1 Answer

0 votes
package javaapplication1;

public class JavaApplication1 {

    public static void main(String[] args) {

        try {

            ProcessBuilder p = new ProcessBuilder();

            p.command("notepad.exe", "d:\\data.txt");
            p.start();

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

/*
             
run:


    
 */

 



answered Nov 27, 2016 by avibootz

Related questions

1 answer 250 views
1 answer 215 views
1 answer 155 views
155 views asked Nov 27, 2016 by avibootz
1 answer 175 views
175 views asked Oct 13, 2018 by avibootz
1 answer 228 views
228 views asked Oct 13, 2018 by avibootz
1 answer 246 views
1 answer 229 views
229 views asked Oct 5, 2018 by avibootz
...