Open notepad java program

Open notepad java program

If you want to open notepad using java program please use sample java code below:

package com.javahonk;

import java.io.IOException;

public class OpenNotepad {

    public static void main(String[] args) {

        Runtime runtime = Runtime.getRuntime();
        try {
            runtime.exec("notepad");
        } catch (IOException e) {
            e.printStackTrace();
        }

    }

}

Output Notepad:

Open notepad java program

Leave a Reply

Your email address will not be published. Required fields are marked *