Forum Stats

  • 3,767,936 Users
  • 2,252,732 Discussions
  • 7,874,385 Comments

Discussions

exec() locks

843798
843798 Member Posts: 24,864
edited Aug 3, 2001 8:18AM in Java Runtime Environment (JRE)
I need to run an application from inside java.
So, I wrote this code, but the first time I run it, I used
the 'calc' instead of 'notepad'.
Now, it always calls the calculator, not the notepad.
Even after closing the application and rebooting de computer.

Can anyone help me?
Tanks.


public static void main(String[] args)
{
Runtime s = Runtime.getRuntime();
try
{
Process q = s.exec("notepad");
q.waitFor();
}
catch(Exception ex)
{
System.out.println(ex.getMessage());
}

}

Comments

This discussion has been closed.