Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

CreateProcess error on Runtime.getRuntime().exec(...)

1 view
Skip to first unread message

Troy Dugger

unread,
Sep 3, 1999, 3:00:00 AM9/3/99
to
I have seen this question posted a couple of time in 1998 and the suggestion
doesn't seem to be working for me. Can someone tell me why I am getting
this error
message?? and what is "error=2" mean?

Here is the code segment:
theProgram[0]="cmd /c java AddressBoookGUI";
Runtime rn=Runtime.getRuntime();
try
{
Process proc = rn.exec(theProgram);
}
catch(IOException exception)
{
System.err.println(exception.getMessage());
exception.printStackTrace();
}

I get this error...

java.io.IOException: CreateProcess: "cmd /c java AddressBoookGUI" error=2
CreateProcess: "cmd /c java AddressBoookGUI" error=2
java.io.IOException: CreateProcess: "cmd /c java AddressBoookGUI" error=2
at java.lang.Win32Process.create(Native Method)
at java.lang.Win32Process.<init>(Win32Process.java:64)
at java.lang.Runtime.execInternal(Native Method)
at java.lang.Runtime.exec(Runtime.java:272)
at java.lang.Runtime.exec(Runtime.java:219)

I have tried just "java ..." and "start java ..", both give the same
results.
Thanks for any hep you give,
Troy


PPAATT

unread,
Sep 3, 1999, 3:00:00 AM9/3/99
to
> "error=2"

Meaning of an exit value varies MUCH by platform. I think I remember some
flavours of Windows use code 2 to mean file-not-found. I mention this mostly
because I'm very curious to know if "cmd /c java AddressBoookGUI" works if you
enter it at the command line. Me, I'd think you'd have to type "cmd /c java
AddressBookGUI" ... but that's certainly a guess without knowledge.


Pat LaVarre p.la...@ieee.org http://members.aol.com/ppaatt/nqjava/


0 new messages