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 342 views
1 answer 301 views
1 answer 225 views
225 views asked Nov 27, 2016 by avibootz
1 answer 268 views
268 views asked Oct 13, 2018 by avibootz
1 answer 297 views
297 views asked Oct 13, 2018 by avibootz
1 answer 339 views
1 answer 321 views
321 views asked Oct 5, 2018 by avibootz
...