how to use java to execute IE7 in Window 2003?

I

IchBin

Nick said:
how to execute IE7?
thanks!

Sorry, you need to explain a lot more...


Thanks in Advance...
IchBin, Pocono Lake, Pa, USA http://weconsultants.phpnet.us
__________________________________________________________________________

'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-)
 
N

Nick

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){

}
 
A

Andrew T.

Nick said:
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.
 
T

Thomas Fritsch

Nick said:
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");
 
L

lordy

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){


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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top