how to run any installed application through my java application??
hello programmers,
can you please let me know how to run any installed application in my computer through my java application?? ( say for example, i need open notepad, recording audio application etc., through my java application )
please help me by answering or guiding....
Re: how to run any installed application through my java application??
Hello sgsamanthjain. Welcome to the Java Programming Forums.
In future, please make sure you post in the correct forum. I have moved this thread to - Java Theory & Questions
You can open Notepad and other applications like this:
Code Java:
import java.io.IOException;
public class OpenApplication {
/**
* JavaProgrammingForums.com
*/
public static void main(String[] args) throws IOException {
// Opens Notepad
Process p1 = Runtime.getRuntime().exec("notepad");
// Opens Windows Calculator
Process p2 = Runtime.getRuntime().exec("C:\\WINDOWS\\system32\\calc.exe");
}
}
Runtime (Java Platform SE 6)
Execute an external program - Real's Java How-to