How to open notepad using java code

Below is the java source code in order to open the notepad application. Once after running this program your notepad application will be opened.

import java.io.IOException;

class Notepad {
    public static void main(String[] args) {
        Runtime rs = Runtime.getRuntime();

        try {
            rs.exec("notepad");
        } catch (IOException e) {
            System.out.println(e);
        }
    }
}

2 comments:

  1. Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here.
    Kindly keep blogging. If anyone wants to become a Front end developer learn from javascript and jquery training in chennai .
    or learn thru Javascript Training in Chennai.
    Nowadays JavaScript has tons of job opportunities on various vertical industry. javascript and jquery training in chennai

    ReplyDelete
  2. Great blog!!! Your blog has all the information on core java and other related stuff. Thanks for sharing and keep blogging!!!

    Cheers,
    http://www.flowerbrackets.com/how-to-open-notepad-in-java/

    ReplyDelete