Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

Q1486 How would you execute a process from within Java?

irt.org | Knowledge Base | Java | Q1486 [ previous next ]

Q1486 How would you execute a process from within Java?

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?'


Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.