hi Erb,
thanks for the tip on the waitFor().

I did try it on javaw outside IDEA.
it always fails with javaw.exe and succeed with java.exe

best regards,
Ofer


> -----Original Message-----
> From: Erb [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, September 26, 2001 5:31 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [Eap-list] how to set idea to use java.exe instead of
> javaw.e xe on NT
> 
> 
> I think calling waitFor() before reading the input stream is a
> practice you cannot depend on.  This depends on the assumption that
> the buffer will not fill up before the app is done.  If the 
> app produces 
> too much
> output, it will block until you read from the input stream, 
> and the process
> will never exit. (since you never read the output until the 
> process exits).
> It is possible that the environment you run this under
> (command line vs. IDEA, or java vs. javaw) will change the behavior.
> By the way, did you try running it under javaw outside IDEA?
> 
> Nivy, Ofer wrote:
> 
> > hi Eugene,
> > 
> > I'm reading the InputStream of a Process that runs 
> "command.com /c set".
> > This is a workaround to get the environment variables.
> > 
> > When run through IDEA (with javaw.exe) a DOS window(command) briefly
> > appears, and the code fails.
> > 
> > for example:
> > 
> > the following code prints the TMPDIR environment variable:
> > 
> >         Process proc = Runtime.getRuntime ().exec 
> ("command.com /c set");
> >         proc.waitFor ();
> >         Properties properties = new Properties();
> >         properties.load(proc.getInputStream ());
> >         System.out.println(properties.getProperty("TMPDIR"));
> > 
> > it will work fine if run with java.exe (from outside IDEA, 
> or as external
> > tool), but will print
> > "null" if run from IDEA.
> > 
> > currently I can't debug/run this code :(
> > 
> > are you planning to make this configurable? this is also 
> useful for using
> > different JDKs.
> > can you suggest a workaround for the meantime?
> > 
> > 
> > thanks,
> > Ofer Nivy
> > 
> > -----Original Message-----
> > From: Eugene Zhuravlev [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, September 25, 2001 5:39 PM
> > To: [EMAIL PROTECTED]
> > Subject: Re: [Eap-list] how to set idea to use java.exe instead of
> > javaw.exe on NT
> > 
> > 
> > Hi Ofer,
> > 
> > Currently this is hardcoded. Why do you need such a functionality?]
> > 
> > Best regards,
> > Eugene Zhuravlev,
> > IntelliJ Software, http://www.intellij.com/
> > "Develop with pleasure"
> > 
> > 
> > ----- Original Message -----
> > From: "Nivy, Ofer" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Tuesday, September 25, 2001 19:17
> > Subject: [Eap-list] how to set idea to use java.exe instead 
> of javaw.exe on
> > NT
> > 
> > 
> > 
> >>hi,
> >>
> >>Is there a way to configure IDEA to use java.exe and not 
> javaw.exe for
> >>Run/Debug?
> >>My OS is windows NT4.
> >>
> >>thank,
> >>
> >>Ofer Nivy
> >>
> >>_______________________________________________
> >>Eap-list mailing list
> >>[EMAIL PROTECTED]
> >>http://www.intellij.com/mailman/listinfo/eap-list
> >>
> > 
> > 
> > 
> > _______________________________________________
> > Eap-list mailing list
> > [EMAIL PROTECTED]
> > http://www.intellij.com/mailman/listinfo/eap-list
> > 
> > _______________________________________________
> > Eap-list mailing list
> > [EMAIL PROTECTED]
> > http://www.intellij.com/mailman/listinfo/eap-list
> > 
> > 
> 
> 
> -- 
> 
> Erb
> 
> ==============================================================
> "The only time I like in the morning is afternoon."
>      - Russell D. Cooper
> 
> "If you do everything, then you're all done."
>      - Melissa F. Cooper
> 
> "Most of you are familiar with the virtues of a programmer.
> There are three, of course: laziness, impatience, and hubris."
>      - Larry Wall
> ==============================================================
> 
> 
> _______________________________________________
> Eap-list mailing list
> [EMAIL PROTECTED]
> http://www.intellij.com/mailman/listinfo/eap-list
> 

_______________________________________________
Eap-list mailing list
[EMAIL PROTECTED]
http://www.intellij.com/mailman/listinfo/eap-list

Reply via email to