Executing System .exe File of Windows from Core Java

One of my friend was trying to open system calculator and notepad from core Java coding, in windows XP. As he was not getting the solution, after some browsing I found the solution which works very well with xp as well as notepad. I found the trick to be very useful. If we are buliding application for windows, why should we crack our head to build application like calculator and notepad for our system?, which is already very well there in windows.

We have an exec method in Runtime class, which can be used to execute the windows executable file.

For Notepad:


For Calculator:


These command should be in try block

try {
 } catch (Exception ex) {

I hope in some kind of project it may help you.