If you registered the .txt extension in your OS and your text file already exists, you can even
Runtime.getRuntime().exec(new String[]{"cmd.exe","/c","text.txt"});
The advantage is that the program will be associated with .txt, which may differ from notepad.exe.
PeterMmm
source share