summaryrefslogtreecommitdiff
path: root/libjava/testsuite/libjava.lang/Process_6.java
blob: 3bf015f760b3ce9957a2c67e5ce6bbd5f907477c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Create a running process for a non existent executable.
// Verify that IOException is thrown.
import java.io.IOException;


public class Process_6
{
  public static void main(String[] args)
  {
    try
      {
	int c;
	Runtime r = Runtime.getRuntime();
	String[] a = { "blablabla_failure" };

	try
	  {
	    Process p = r.exec(a);
	    System.out.println("bad");
	  }
	catch (IOException ioe)
	  {
	    System.out.println("ok");
	  }
      }
    catch (Exception ex)
      {
	System.out.println(ex.toString());
      }
  }
}