mirror of
https://github.com/autc04/Retro68.git
synced 2024-12-26 16:29:28 +00:00
32 lines
528 B
Java
32 lines
528 B
Java
// 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());
|
|
}
|
|
}
|
|
}
|