Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calling an exe in java

Status
Not open for further replies.

Stevoie

Programmer
Jun 7, 2001
68
IE
Is it possible to call an exe within java, eg a user presses a button and the java program calls the explorer.exe

Can this be done?
Thanx
 
yes it can, just do something like

import java.lang.Runtime;

Runtime rt = java.lang.Runtime.getRuntime();

try {
rt.exec("c:\\path_if_needed\\app.exe");
} catch(Exception ex){
System.out.println("Error message");
}

hope this helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top