Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q1486 How would you execute a process from within Java?

You are here: irt.org | FAQ | Java | Q1486 [ previous next ]

Try:

import java.lang.System;
import java.lang.Runtime;
import java.io.IOException;

public class loadNotepad {
  public static void main(String args[]) throws IOException {
    Runtime r = Runtime.getRuntime();

    Process p = null;

    try {
      p = r.exec("C:\\windows\\notpad.exe");
    }
    catch (Exception e) { }
  }
}

Submitted by venkat

Feedback on 'Q1486 How would you execute a process from within Java?'

©2018 Martin Webb