when i type "iexplore.exe" in "start"--> "Execute"--> "iexplore.exe"
then press ENTER
The IE will appear,but when i execute the following code in Java , i
can't execute the IE, WHY?
and what is the meaning of "p.waitFor();"
thanks!
try{
Runtime rt = Runtime.getRuntime();
Process p = rt.exec("iexplore.exe ");
p.waitFor();
}catch(Exception ex){
}
chBin wrote:
>> how to execute IE7?
>> thanks!
[quoted text clipped - 7 lines]
> 'If there is one, Knowledge is the "Fountain of Youth"'
> -William E. Taylor, Regular Guy (1952-)
Andrew T. - 07 Jul 2006 10:16 GMT
> when i type "iexplore.exe" in "start"--> "Execute"--> "iexplore.exe"
> then press ENTER
> The IE will appear,but when i execute the following code in Java , i
> can't execute the IE, WHY?
Note 'The IE' might end up being 'The FireFox', 'The Safari',
'The Lynx'...
BrowserLauncher2 finds and opens the default browser on
a number of platforms. Maybe you should look at how they
do it (BL2 is open source).
Andrew T.
Thomas Fritsch - 07 Jul 2006 10:43 GMT
> when i type "iexplore.exe" in "start"--> "Execute"--> "iexplore.exe"
> then press ENTER
> The IE will appear,but when i execute the following code in Java , i
> can't execute the IE, WHY?
> and what is the meaning of "p.waitFor();"
Did you read the API doc?
http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Process.html
http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Runtime.html
> thanks!
>
> try{
>
> Runtime rt = Runtime.getRuntime();
> Process p = rt.exec("iexplore.exe ");
Omit the trailing blank:
Process p = rt.exec("iexplore.exe");
> p.waitFor();
>
> }catch(Exception ex){
>
> }

Signature
Thomas
lordy - 07 Jul 2006 21:52 GMT
> when i type "iexplore.exe" in "start"--> "Execute"--> "iexplore.exe"
> then press ENTER
[quoted text clipped - 10 lines]
>
> }catch(Exception ex){
If you dont put anything here you will not see your errors. Any time you
thought you saved by not typing anything here is wasted several times
over by not displaying /logging errors.
> }
Lordy