Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / December 2005

Tip: Looking for answers? Try searching our database.

Process Builder

Thread view: 
Meidan - 27 Dec 2005 10:03 GMT
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.



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.