wood burning stoves 2.0*
The moose likes Java in General and the fly likes How Java Re Run Internet Explorer Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "How Java Re Run Internet Explorer" Watch "How Java Re Run Internet Explorer" New topic
Author

How Java Re Run Internet Explorer

J. Insi
Ranch Hand

Joined: Aug 11, 2010
Posts: 90
Greetings again everyone...!!

Waw! One day, thinking one another, comes up another thing.
Well, surely. I am a Windows User here. I wonder if we could run the Internet Explorer
via Java. After awhile I think, and think, again... i re-think.
I found out that we can execute the "iexplore" using CommandLine via java.
And that one using Runtime object.

But, before that, We need to follow up this algorithm below;
(ensuring the IE directory is set under PATH variable).

1) Regedit Checking
Check to the Location of "HKLM\\System\\CurrentControlSet\\Control\\Session Manager\\Environment"
IF there's a Variable named, "Path", with value of "Internet Explorer".
Then ... We can run the IE.
ELSE
... we need to find out the IE Location... (Geezz).
and then Set the IE Location into previous Path.

2) Find Out IE Location....
Go to the Root location,
Obtain each Folders.
Check its name whether matched with Internet Explorer.
If no, then keep iterating... (Geeezz)


But is there any shorter way rather than those stated above?
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074
    
  16

Is there a requirement to run Internet Explorer specifically, or do you just want to display a webpage in the user's preferred web browser (which might be something else than Internet Explorer)? The best way to launch the user's preferred web browser is by using the Desktop class:



Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
James Sabre
Ranch Hand

Joined: Sep 07, 2004
Posts: 781

http://java.sun.com/developer/technicalArticles/J2SE/Desktop/javase6/desktop_api/

:-( Too late!


Retired horse trader.
 Note: double-underline links may be advertisements automatically added by this site and are probably not endorsed by me.
J. Insi
Ranch Hand

Joined: Aug 11, 2010
Posts: 90
what what??

too late?? Which one??

yes, Jesper de Jong. It's juz wanna run the IE App.
Not the preferrable (user) Browser.
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074
    
  16

I guess James said "too late" because I already answered with more or less the same answer...

Ok, if you specifically want to run Internet Explorer, then you need to do more complicated things. But I don't understand why you insist on running IE especially; users might not like it when you run IE instead of their preferred browser. Also, your code is Windows-only; using the Desktop class works on all operating systems.
J. Insi
Ranch Hand

Joined: Aug 11, 2010
Posts: 90
because, at this moment,
we're just user of IE.

even thought, the Firefox is used as Default Browser here.


he3.
James Sabre
Ranch Hand

Joined: Sep 07, 2004
Posts: 781

J. Insi wrote:because, at this moment,
we're just user of IE.

even thought, the Firefox is used as Default Browser here.


One of the things I have learned over the years is that one's choice of browser has a strong religious aspect. If you try to force someone to use IE or Opera or Firefox or Chrome when they prefer to use a different browser then your users will not get a warm feeling from using your system. Every place I have worked where a browser was involved we have gone to great pains to make sure that we covered the use of all the major browsers going back at least one major version. Not always easy especially with IE but well worth the effort.

P.S. my "Too late" comment was, as surmised, added because in the time it took me to find the URL the question had been answered.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How Java Re Run Internet Explorer
 
Similar Threads
Internet Explorer - HTTP Status 408 - The time allowed for the login process has been exceeded
Class Path Problem with windows 7
IE and NN Compability
After installation, where is log file?
URL-Pattern, Internet Explorer and Flash Videos