Runtime.exec: strange NullPointerException
843798Mar 24 2003 — edited Mar 22 2007Hi there!
Since I'm using Runtime 1.4.1-b21 (Windows) it seems that I can't use Runtime.exec any more. The following example code doesn't work:
public class Test
{
public static void main(String[] args) throws Exception
{
Runtime lRuntime = Runtime.getRuntime();
Process lProcess = lRuntime.exec("last.exe");
}
}
I get the following null pointer exception:
D:\test>java Test
Exception in thread "main" java.lang.NullPointerException
at java.lang.Runtime.exec(Runtime.java:551)
at java.lang.Runtime.exec(Runtime.java:491)
at java.lang.Runtime.exec(Runtime.java:457)
at Test.main(Test.java:23)
I don't know why this happens. 'last.exe' is a simple command line tool. I can use any other program - same error!
Greeting,
Markus