Skip to main content

Java code for opening installed application of the system

  The method exec() present in java.lang.Runtime class is used for opening application that are installed in your system. See the below example.

public class ExecDemo {
  public static void main(String args[]) {
    try{
Runtime.getRuntime().exec("notepad.exe ExecDemo.java");
    }
    catch(Exception e) {
e.printStackTrace();
    }
  }
}

Here the "notepad.exe" refer the name of the exe name and "ExecDemo.java" refer the file name. The file present in some other directory then you need to give the full path of the file.

Comments

Anonymous said…
It 1xbet is not the best promotion however it’s price claiming anyhow. Like its sisters, Jackpot City is powered solely by Microgaming software. It primarily targets Canadian gamers and is considered some of the well-liked sites there! But that does not mean solely Canadians can benefit from the big bonuses at this casino. Casino Jackpot City has a no obtain immediate play option that runs in your browser. It additionally comes with all the features that make real money gaming exciting.