Hi,
I added the following command to my code:
ProcessBuilder pb = new ProcessBuilder("myCommand", "myArg1",
"myArg2");
and got this error message:
"The constructor ProcessBuilder(String, String, String) is undefined"
Does anyone knows what's the problem?
Thanks.
Andrew Thompson - 27 Dec 2005 10:33 GMT
> I added the following command to my code:
>
[quoted text clipped - 3 lines]
> and got this error message:
> "The constructor ProcessBuilder(String, String, String) is undefined"
Perhaps what Sun *meant* to say at the top of their 1.5
JavaDocs for ProcessBuilder was..
String[] commands = {"myCommand", "myArg1", "myArg2"};
ProcessBuilder pb = new ProcessBuilder(commands);
..note the array of commands, which matches this constructor.
<http://java.sun.com/j2se/1.5.0/docs/api/java/lang/ProcessBuilder.html#ProcessBui
lder(java.lang.String...)>
HTH

Signature
Andrew Thompson
physci, javasaver, 1point1c, lensescapes - athompson.info/andrew
Roedy Green - 27 Dec 2005 10:52 GMT
>ProcessBuilder pb = new ProcessBuilder("myCommand", "myArg1",
>"myArg2");
>
>and got this error message:
>"The constructor ProcessBuilder(String, String, String) is undefined"
I gather you are using a pre 1.5 java. ProcessBuilder( String...) was
only invented with 1.5.
prior to that you would have had to use new Strin[] { .... };
see http://mindprod.com/jdk.html
to get 1.5. It is about a year old now.

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.