How to open Internet explorer from java

how can one open internet explorer through java and also displays the desired webpage in it.

p = r.exec(runie);Whenever you use exec on a Runtime object, you need to get an InputStream off the System.err output. If this InputStream is not absorbed in some way, then it can stop the process. The process may not reach its destined finish point. The Java Documentation does not inform you of this, though experience will give you some unanswered questions, such as 'Why does this process never reach the finish point'.
James

Similar Messages

  • Open Internet explorer from Java

    Hi everyone!
    Doew anybody know how to open IOnternet Explorer from Java.I have tried
    String browserCommand = ("\"C:\Program Files\InternetExplorer\iexplore.exe\"");
         URL theUrl=new URL("http://www.yahoo.com/"); // or whatever
         Runtime.getRuntime().exec(browserCommand+ " "+theURL);
    but something goes wrong with the escape characters I use.
    I would be greatful to receive any advice.
    Thanks in advance!

    or...
        private static boolean showInBrowser(String url){
             String os = System.getProperty("os.name").toLowerCase();
            Runtime rt = Runtime.getRuntime();
            try{
                 if (os.indexOf( "win" ) >= 0) {
                      // this doesn't support showing urls in the form of "page.html#nameLink"
                     rt.exec( "rundll32 url.dll,FileProtocolHandler " + url);
                 } else if (os.indexOf( "mac" ) >= 0) {
                     rt.exec( "open " + url);
                 } else if (os.indexOf( "nix") >=0 || os.indexOf( "nux") >=0) {
                      // Do a best guess on unix until we get a platform independent way
                      // Build a list of browsers to try, in this order.
                      String[] browsers = {"epiphany", "firefox", "mozilla", "konqueror",
                                "netscape","opera","links","lynx"};
                      // Build a command string which looks like "browser1 "url" || browser2 "url" ||..."
                      StringBuffer cmd = new StringBuffer();
                      for (int i=0; i<browsers.length; i++)
                           cmd.append( (i==0  ? "" : " || " ) + browsers[i] +" \"" + url + "\" ");
                      rt.exec(new String[] { "sh", "-c", cmd.toString() });
                 } else {
                      return false;
            }catch (IOException e){
                 return false;
            return true;
        }

  • How to open Internet Explorer files?

    I have a bunch of Internet Explorer files that I transferred from my old OS 9 iMac. Now, it seems, I can't open any of them. These are web pages I saved for research purposes, and I would really like to open them if at all possible. It was suggested that Opera 9 could open Internet Explorer files; but, I tried that and it didn't work. Does anyone know how I might do that?
    Carl Kalwaitis

    Archives that you saved with Internet Explorer can only be opened by Internet Explorer.
    These are essentially a single file that contains the entire site.
    Other browsers save files, pictures, and supporting information in a folder for each page you save.
    But, Internet Explorer wraps all that into a single file (a web archive). This format is naturally only compatible with Internet Explorer.
    You need to get the latest version of Internet Explorer for Mac OS X.
    Microsoft has officially abandoned this browser. So, they are not offering it or supporting it anymore.
    But, you can still locate a copy for downloading at:
    http://web.nickshanks.com/browsers/ie/macosx
    Hope this helps.

  • Lauching Internet Explorer from java program

    How can I lauch internet explorer from a java program. I need codes
    Thanks

    What? Is this the Question of the Day or something?
    http://forum.java.sun.com/thread.jsp?forum=31&thread=342624&tstart=0&trange=30

  • Open an Explorer from Java

    How i can open the default explorer from Java and redirect it to an especific URL?

    here is a code snippet that might help.
       public StringBuffer getMainPage (String host, String port, boolean sendToBrowser)
          String       url  = "http://" + host + ":" + port;
          String       line = "";
          StringWriter sw   = new StringWriter();
          // send it.
          post(line, url, sw);
          try
             if ( sendToBrowser )
                // send the default browser to the proper page for this host
                String cmd = "rundll32 url.dll,FileProtocolHandler " + url;
                // System.out.println("cmd =" + cmd );
                Process p = Runtime.getRuntime().exec(cmd);
          catch ( Exception e )
             // e.printStackTrace();
          // System.out.println(" output ='" + sw.toString() + "'" );
          if (sw.toString().length() != 0)
             return sw.getBuffer();
          else
             return null;
       }

  • Opening Internet Explorer from a link w/ applet

    Hi there,
    I was wondering if anybody out there had the code for an applet that will spawn Internet Explorer application and open up a specific address.
    How we want it to work. From a link open a page that will spawn Internet Explorer with the help of the applet. Is it do-able or not?
    A quick response would be great.
    Thanks

    Thanks but I would need the complete code.
    You see I want to open a particuler page from a link, the link will call, lets say homepage.jsp, I want to include an applet in homepage.jsp that will force the page to open up in a IE window. Is that possible????
    If it is what do I need to do?
    Thanks

  • How to close Internet Explorer from webforms?

    How can i close internet explorer when i click on the exit button in my form? when i click the exit button (exit_form working behind the scenes) the forms closes but leaves a blank applet window of IE behind, how can i incorporate closing IE from the exit button?

    Create a file called close.html
    Add in some java script to close a window
    e.g.
    window.close
    //This is not the exact code but its roughly like this.
    Then in your POST_FORM trigger call web.show_document("close.html").
    regards
    Grant Ronald
    FOrms Product Management

  • Why does it open internet explorer from my mail to open another page now when it didnt before

    when i go to go from my mail to a page it opens up internet explore to do it and not fire fox i cant get in to change the settings to see if they are set right

    Sounds like Firefox isn't your Default Browser.
    https://support.mozilla.com/en-US/kb/How%20to%20make%20Firefox%20the%20default%20browser

  • Opening Internet Explorer from Air Iframe

    This probably has been answered here before and I apologize if this is a repost but I haven't been able to find an answer that works.
    I have an AIR application that uses an Iframe to connect to a server side page. within that page I need to be able to click a link and launch an Internet Explorer Browser NOT an Air window.
    I have tried several methods and none seems to work,
    does anyone have a sample (both the parent and child frames) that they know works ,
    It will save me allot of headache
    I truly appreciate it 
    Ray

    Thanks but I would need the complete code.
    You see I want to open a particuler page from a link, the link will call, lets say homepage.jsp, I want to include an applet in homepage.jsp that will force the page to open up in a IE window. Is that possible????
    If it is what do I need to do?
    Thanks

  • How to open internet links from Outlook 2003 using Firefox not IE

    When I open an internet link from Outlook 2003 it always opens with Internet Explorer. I want to open with Firefox.
    == This happened ==
    Every time Firefox opened
    == ?

    Try this - http://www.gamevance.com/deactivate.php

  • How to Force Internet Explorer specific Java Runtime Environment?

    Problem: UConn uses a tool called Blackboard. Blackboard requires Version 1.5.0 (build 1.5.0_07-b03)
    but I develop so NETBeans IDE needs/wants JDK6 ( likes JDK 6 Update 16 )
    Tried managing add-ons in IE, Tried Firefox too.
    What I want is to have IE forced to the JDK5 runtime and let my other applications (NetBeans, Oracle, OracleSQLDeveloper, Firefox and MYSQL use the JDK6). I know NEtBeans will allow to specify which JDK but it seems that IE still sees both and screws up.
    Things I tried but didnt work: managing add-ons and I saw items like this Force Internet Explorer to use a specific Java Runtime Environment install?
    from: http://stackoverflow.com/questions/71254/force-internet-explorer-to-use-a-specific-java-runtime-environment-install
    First, disable the currently installed version of Java. To do this, go to Control Panel > Java > Advanced > Default Java for Browsers and uncheck Microsoft Internet Explorer.
    Next, enable the version of Java you want to use instead. To do this, go to (for example) C:\Program Files\Java\jre1.5.0_15\bin (where jre1.5.0_15 is the version of Java you want to use), and run javacpl.exe. Go to Advanced > Default Java for Browsers and check Microsoft Internet Explorer.
    To get your old version of Java back you need to reverse these steps.
    Note that in older versions of Java, Default Java for Browsers is called <APPLET> Tag Support (but the effect is the same).
    The good thing about this method is that it doesn't affect other browsers, and doesn't affect the default system JRE.
    Any ideas?

    bobparis wrote:
    Problem: UConn uses a tool called Blackboard. Blackboard requires Version 1.5.0 (build 1.5.0_07-b03)
    but I develop so NETBeans IDE needs/wants JDK6 ( likes JDK 6 Update 16 )
    Tried managing add-ons in IE, Tried Firefox too.
    What I want is to have IE forced to the JDK5 runtime and let my other applications (NetBeans, Oracle, OracleSQLDeveloper, Firefox and MYSQL use the JDK6). I know NEtBeans will allow to specify which JDK but it seems that IE still sees both and screws up.
    Simple then - bad idea.
    If your minimal target is 1.5 then you develop in 1.5. If you insist on using 1.6 for functional reasons then you will need to maintain two development environments on your box 1.5 and 1.6. You explicitly build support for 1.6 and detection for that into the code and test it using 1.6. And test using 1.5 as well.
    Note you must test both 1.5 and 1.6. Full functional tests.
    Obviously limiting yourself to 1.5 would require less effort (cost.)

  • How to access Internet Explorer in Java?

    Hi,
    I am working on windows 98. I want to write a swing based Java program that embbed Internet Explorer into the JFrame.
    I used JDIC library for it but JDIC does not support windows 98.
    So, is there any library to embbed internet explorer into the JFrame on windows 98 platform?
    regards,
    Anand

    You can write your java application with SWT and embed IE with SWT SDK or get any Java-COM bridge.

  • How can I open Internet Explorer from Forms?

    I could manage to open IE with HOST giving it the correct path from IE in my computer.
    But how can I find out what directory IE is? Should I use OLE2? If yes, then how do I use it?
    Thanks,
    Ariadne

    I thinck that the path doesn't matter...
    Using Host('start http://www.oracle.com') will work no matter where IE is located

  • How to open internet explorer

    I m wrking on a project(single sign on) and want to open a website (say rediffmail ). how do i go abt it. which classes will i have to use?? Also , plz let me know if their is any way thru which i can provide username and paswrd in their respective fields in the webpage so that this programs automatically helps one to directly access the inbox??
    thnks in advance

    hi
    i am able to open the Internet Exp n the page also , but now i have only one problem of putting the input parameters in the text field , like in Yahoo how to input username and password , and then let the the sign button clicked also.
    please suggest me to solve the problem.
    with regards

  • HOW TO OPEN WORD DOCUMENT FROM JAVA???

    hi everyone! Can you please help me to come with this problem? Let me to set my main target I want to achieve:
    1) In my program user should first press a button;
    2) Then already created Word Document should be opened (I DO NOT NEED to open that Word Document in Java or something like JField). Just simply it should be opened as a Microsoft Word Document.
    I DO NEED YOUR HELP! PLEASE HELP ME....!

    Running cmd using the exec is also a windows only solution, there is no "more" or "less" it that solution compared to the rundll.
    Since word is a windows format its pretty obvious that the application is ran under windows platform.
    If you are running on a different platform (maybe using open office you can open word documents, i'm not sure) you might want to use the JDIC library (https://jdic.dev.java.net/) which enables you to open/edit/browse such files using the default viewer/editor/browser of the system you are working on.
    Look at the org.jdesktop.jdic.desktop.Desktop object for these methods.
    You can also find the Desktop object in J2SE6 but its still in beta.

Maybe you are looking for

  • HT5610 I cant play my music in my macbook pro

    Im new in macbook. I try to play my music taht i purchased in iTunes but it said that my computer in to be authorized. Anyone know how to do that? HELP me

  • PO not subject to Release strategy but PR is.

    Hi Friends, I am trying to check what purchases have occured in my organisation which have not been authorised at some point. I first have done a search using table EKKO for PO's not assigned a release strategy and found many.  Therefore I thought we

  • Installing SSD in W520

    Just got a W520 with the 500gb HDD with the intention of switching it out for a SSD. My question is what is the best way to install it with the factory settings? Ive been reading that I can burn the recovery drive to a DVD and boot from that but when

  • Query 1 shows less consistent gets but more cost than Query 2..

    Hi , SQL> select dname from scott.dept where deptno not in (select deptno from scott.emp) Ðñüãñáììá åêôÝëåóçò Plan hash value: 3547749009 | Id  | Operation          | Name | Rows  | Bytes | Cost (%CPU)| Time     | |   0 | SELECT STATEMENT   |      | 

  • Not sure if these issues/feature requests have bee...

    Hi, Really like my Lumia 800 on the whole, however: 1 It would be nice if the player remembered the last position of a podcast. If that's not possible could it be made possible to scroll to a position in a podcast rather keeping fingers on next or pr