Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How Java Re Run Internet Explorer

 
J. Insi
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15207
36
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:


 
James Sabre
Ranch Hand
Posts: 781
Java Netbeans IDE Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://java.sun.com/developer/technicalArticles/J2SE/Desktop/javase6/desktop_api/

:-( Too late!
 
J. Insi
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15207
36
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 781
Java Netbeans IDE Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic