Java tutorial
public class Main { public static void main(String[] args) { try { String[] cmdArray = new String[2]; // the program to open cmdArray[0] = "notepad.exe"; // txt file to open with notepad cmdArray[1] = "data.txt"; String[] envArray = new String[2]; envArray[0] = ""; envArray[1] = ""; Runtime runTime = Runtime.getRuntime(); Process process = runTime.exec(cmdArray, envArray); } catch (Exception ex) { ex.printStackTrace(); } } }