Closing the IE browser thro' Java application

Hi,
I have a requirement wherein I have to close the applications launched like (Internet exploer window) thro my java application.
Can anyone help me on this?
I tried using Runtime class Process.destroy( ) method. But still not able to find the exact one.
Thanks.

maybe this is because the code did not create the process directly, ao destory() method doesn't work as expected.
Process ps = Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + "my website open here")
maybe ps not reference to the process create by rundll32
then there is no way to close a browser directly from java application?

Similar Messages

  • How do i  open browser in java application

    hi....
    please help me!!!!!!!!!!!!!!!!!!!!!!!!!!
    how do i open browser in java application ? ( for show javascript in java application)
    thank you.......

    You can run any program from java by doing
    Runtime.getRuntime().exec("mybrowser myjavascriptfile.js");
    The real question is why would you want to.
    I would suggest you rethink whether running Javascript from Java is a good idea.

  • Does the iphone browser support java

    does the iphone browser support java?
    can it run java applets?

    No, there is no Java support in the iPhone. (There is javascript, but that's obviously quite different.)
    You can submit feedback to Apple: http://www.apple.com/feedback/iphone.html

  • Help-how can i connect to the XE through my java application?

    Hi, i am trying to connect to the XE through my java application. I have downloaded the jdbc driver tho. but the error occured: cant find the symbol (class oracledatasource not found) . could anyone here tell me what else should i try to fix it? where should i put the jdbc packages ? anyone's prompt reply would be much appreciated! thanks a lot.

    Hi ,thank you very much for your guide.
    i am actually trying to connect to the XE server through my JSP files.
    i download the Oracle jdbc driver packages and put them in the same folder with JSP files. but i did not set the class path tho.
    do i have to set the enviroment variables for the classpath of Oracledatasource class? thanks a lot.
    another problem i got is installing the JDeveloper, it seemed my computer just got stuck there when installing JDeveloper. my laptop is with 256MB memory tho.
    the code i used to connect to the XE server in my jsp file is as below:
    <%@ page language="java" contentType="text/html"%>
    <%@ page import="java.sql.*" %>
    <%@ page import java.sql.Connection%>;
    <%@page import java.sql.SQLException%>;
    <%@page import oracle.jdbc.pool.OracleDataSource%>;
    <%@ page import="java.io.*" %>
    <% String jdbcUrl = "jdbc:oracle:thin:@localhost";
    Connection conn;
    OracleDataSource ds;
    ds = new OracleDataSource();
    ds.setURL(jdbcUrl);
    conn = ds.getConnection(jdbcUrl);
    %>
    dose it have some problems there?
    thanks a lot.
    Message was edited by:
    Novice

  • How to import the image by using java application

    1.how to import the image by using java APPLICATION and display it on the textarea that you have been created.
    2.how to store the image into the file.
    3. what class should i used?
    4. how to create an object to keep track the image in java application.
    * important : not java applet.
    plzzzzzzz.
    regards fenny

    follow the link:
    http://java.sun.com/docs/books/tutorial/2d/images/index.html

  • How to create the exe files for java application

    How to create the exe file for java application?
    got any software to do that?
    Thanks

    In terms of converting java applications into exe files, there are 3 schools of thought:
    1) Instead of converting it to an exe, convert it to a jar file. Jar files are more portable than exe files because they can be double-clicked on any operating system. The caveat is that a Java interpreter must be installed on the target computer for the double-clicking to work.
    http://developer.java.sun.com/developer/Books/javaprogramming/JAR/
    2) Create an exe launcher that, when double-clicked, attempts to find a Java interpreter on the local computer and launches the Java application. The exe file is still double-clickable but whether your java application runs depends on whether a Java interpretor is installed on the target computer.
    http://www.sureshotsoftware.com/exej/
    http://www.objects.com.au/products/jstart/index.jsp
    http://www.duckware.com/products/javatools.html
    http://www.ucware.com/jexec/
    http://www.rolemaker.dk/nonRoleMaker/javalauncher/
    http://www.jelude.cjb.net/
    http://thor.prohosting.com/~dfolly/java/index.html
    3) Create an exe launcher that bundles a Java interpretor. Same as above but when the exe file is double-clicked, it searches for a Java interpreter and if one is not found, it installs one on the target computer. The caveat is that the exe file would have an overhead of 10 MB in size for the interpreter.
    http://www.excelsior-usa.com/jet.html (evaluation version available)
    4) Convert the Java application into a native exe file. The caveat is that if you use Swing for your GUI, it won't be converted. Also this option is still somewhat experimental.
    Can't think of any free options right now.

  • Easiest way to launch a link to the default browser from java?

    Is there an easy way to launch a link in the default browser from java? Ideally I would have a graphic in a cell that when clicked on would open a new window/tab in the default browser. This would be done in SWT, but it might be similar to swing, awt, etc. Any ideas?

    If you are using Java 1.5 or earlier, I found the browser launch code found here to work fairly well: http://www.centerkey.com/java/browser

  • Generated JNLP and closing the original browser window

    Hi All, This is my first post so bear with me. Here is my problem.
    I am using Web Start for an application.
    I need to check to see if web start is installed or not.
    If it is NOT I need to auto-install
    if it is I need to call a servlet that dynamically generates the jnlp with the user that I passed in as <arguments/> maybe other arguments in the future also
    I need to shut the original browser window
    I will use this servlet in multiple web apps
    I have it working like this but I don't think it is clean enough
    I call a servlet with the syntax checkJREServlet?USER=username
    this servlet writes out:
    <html>
    <body>
    <h1>Installing Java Runtime</h1>
    <OBJECT
    CLASSID="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
    width="0" height="0"
    codebase="http://<myservler>/<plugins folder>/j2re-1_4_2-windows-i586.exe#Version=1,4,2,0">
    <PARAM NAME="code" VALUE="redirectAndClose.class"> //my applet class
    <PARAM NAME="archive" VALUE="RedirectUtil.jar"> //the jar where my applet class is stored
    <PARAM NAME="archive_cache" VALUE="RedirectUtil.jar">
    <PARAM NAME="type" VALUE="application/x-java-applet">
    <PARAM NAME="where_to_next" VALUE="http://<myservler>/<mywebapp>/openAppServlet?USER=username">
    You did not install Java.
    <p>Please use the <b>Back</b> button to return to the previous page.
    </OBJECT>
    </body>
    </html>
    I have redirectAndClose which is:
    import java.applet.Applet;
    import java.net.URL;
    import java.net.MalformedURLException;
    import netscape.javascript.*;
    public class redirectAndClose
    extends Applet
    java.util.Timer timer = null;
    int seconds = 5;
    public void start()
    try
    getAppletContext().showDocument(
    new URL(getCodeBase(), getParameter("where_to_next")), "_blank");
    //now we have to close ourselves in 5 seconds
    timer = new java.util.Timer();
    timer.schedule(new java.util.TimerTask()
    public void run()
    timer.cancel(); //Terminate the timer thread
    destroy();
    , seconds * 1000);
    catch(MalformedURLException e)
    throw new RuntimeException(e);
    public void destroy()
    super.destroy();
    //close this window because we don't need it
    JSObject win = (JSObject)JSObject.getWindow(this);
    win.eval("window.opener=self;self.close();");
    If try to close without a timer my entier session gets killed, including my webstart app that the openAppServlet wrote out the jnlp for
    I hate this because it is not definite. I want to DEFINITELY know when my webstart app is open and I can close this original window. Like a whenWindowExists then close me but I have no clue how to do this.
    The "where_to_next" location is a servlet that will dynamically build a jnlp file specific for each web app building it from parameters in web.xml for each individual web app. Basically I will have to store the actual name of the class, the jar href's I will be needing, title, vendor, description, basically everything that can be different.
    So what I need is some kind of library so I can include it in multiple web apps EASILY. I don't want to have to write a document on how to include this thing. It should be self explainatory. I originally just mapped to the first servlet in my web.xml and then included the jar file but it appears to be non-existent in my project. Maybe some suggestions on what others would do may help me.
    Thanx in advance

    I don't want to use a timer because who knows if the servlet that writes out the dynamic jnlp will get hung up for a little while or any number of other reasons. If that did happen the timer would kick off and close my web start app. I cannot have this.

  • How to connect other mobile web browser to java application.

    I'm trying to write an application in j2me and wondering how can i take the requested url from the default web browser of mobile phone to my java application and download page using java application and send the downloaded data to that browser.
    I don't know any API that do this.
    Please help...

    take a look at [Java ME Content Handler API (CHAPI), JSR 211|http://java.sun.com/products/chapi/]
    - CHAPI +"...manages the action to handle [Uniform Resource Identifiers|http://en.wikipedia.org/wiki/Uniform_Resource_Identifier|Wikipedia article] (URI) based on a MIME-type or scheme. CHAPI provides the capabilities for browsers and native applications as well as Java ME applications to invoke other Java ME applications which dynamically extend the media types and capabilities supported by the device's application environment...."+

  • If Firefox is set as the default browser, and any application attempts to open a new window, this fails and I get the error "Firefox is already running..."

    Here is what I am running:
    Microsoft Windows 7, Service Pack 1, Fully updated to 4/10/2012
    Fresh Install of Firefox 11. No add-ons enabled as a result of troubleshooting.
    I am a user with administrator rights
    UAS is disabled.
    To begin, this has been going on Since Firefox 10 or so. A few months now.
    I am able to open Firefox. My add-ons worked (ABP, Flashblock, ABP Element Hiding Helper, IETAB2, Downthemall, Greasemonkey, 4chan extension) had no problems. Firefox is set and has been set for the last two years as my default web browser.
    However Since approximately Firefox 10 or so, maybe before that, If I have a Firefox session open, and any other application attempts to open a session in a new window, I get the Firefox is already running, but not responding error."
    I attempted to follow troubleshooting advice already posted (look for parent.lock files left behind [none present], multiple sessionstore.js files [none present], create a new user profile, attempted to clear out the "read-only" permission in windows 7, however as soon as it is cleared, the read only permission returns.)
    As a last resort, I deleted the Firefox folder, the %APPDATA%/Mozilla directory in its entirety, then utilized CCleaner to remove any and all references to Firefox in the windows registry, then did a full re-install, no extensions installed right now.
    I checked preferences and have the option "open new windows in a new tab" checked off. The problem persists regardless if this option is checked on or off. This problem persists in or out of safe mode, even with the brand new install.
    Test Cases:
    All cases:
    Firefox is selected as the default browser for windows 7
    Case 1: Open a firefox session. Utilize any other program that attempts to open a link to their website in a new browser window or new browser session. Experience "Firefox is already running" error
    Case 2: Open a firefox session. Right click on Firefox on the task bar. Select "open in new window". Experience "Firefox is already running" error
    Case 3: Open a firefox session. Select the Firefox Menu > New tab > New Window. A new window will actually open.
    This is the only method of opening a new window in the same browser session or profile that actually works on my system. Attempting to open a browser session from the task bar "open new window dialog" or opening a new window while a current window/session is running will not open firefox in a new window or a new tab in the current session. The "Firefox is already running, but is not responding" error will occur every time.

    Cor-el's suggestion resolved my problem. Apparently the MOZ_NO_REMOTE variable was set to 1 on my system variables. I never made it, and really have no idea how it got there, but deleting this variable and restarting firefox has resolved the issue. Thanks Cor-el!
    Marking case: Solved
    Solution: Verify the MOZ_NO_REMOTE variable is NOT set to 1. This can be achieved by simply deleting this variable.

  • How to assign the Thems into Webdynpro Java Application

    HI All,
                   I Downloaded the plugin for them editor and i add those plugins and i created the Them. Please any one can help me how to add that Them into Webdynpro java application.

    Hi ep bhargav,
    You can check this link.....
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/ccb6bcf4-0401-0010-e3bc-ec0ef03e13d1
    Re: webdynpro theme editor
    Thanks.
    Venkat.

  • Setting the system property in java application

    Hi,
    I want to make a connection to https://URL through my java application class
    which will be deployed in the weblogic server. Could any one help by
    telling how could I set the system properties in my java application. If I
    pass the value in the java class do I have to change any value in the
    weblogic.properties file.
    Thanks in advance and looking forward to hear your valuable suggestion.
    Sirisha

    System.getProperty(..)
    System.setProperty(..) is this what you are asking for?
    This gets and sets the system (your machine) environment properties
    Filip
    In article <396d0a93$[email protected]>, [email protected] says...
    >
    Hi,
    I want to make a connection to https://URL through my java application class
    which will be deployed in the weblogic server. Could any one help by
    telling how could I set the system properties in my java application. If I
    pass the value in the java class do I have to change any value in the
    weblogic.properties file.
    Thanks in advance and looking forward to hear your valuable suggestion.
    Sirisha
    Filip Hanik
    Software Architect
    XMarkstheSpot.com
    [email protected]

  • Lauch IE browser from Java Application

    Hi, I am interested in launching an IE window from a Java application. Is there a way
    to accomplish this? Thanks.

    Again, any other way that allows me to start a java application and IE browser on WINDOWS2000 would be helpful too.

  • How to get  current working directory of the ftp server,in java application

    Hi All,
    I?m FTP?ing the file using java.net.url.
    Here is the snippet of the code:
    public void ftpFile()throws ChrsException
    try
    System.out.println("FTPing the file '"+localfile+"'");
    OutputStream os = openUploadStream(targetfile);
    FileInputStream is = new FileInputStream(localfile);
    byte[] buf = new byte[16384];
    int noOfBytesRead;
    while (true)
    //Read the data from the source File into buf
    noOfBytesRead = is.read(buf);
    if (noOfBytesRead <= 0)
    break;
    //Writes the data present in the buf to the target file
    os.write(buf, 0, noOfBytesRead);
    os.close();
    is.close();
    close();
    System.out.println ("The file '"+localfile+"' is Sucessfully FTP'd to '"+targetfile+"'");
    catch (MalformedURLException malExcp)
    System.out.println ("Invalid URL. Error in FTP'ing the file: \""+localfile+"\"");
    catch(IOException ioe)
    System.out.println ("Error in FTP'ing the file: \""+localfile+"\"");
    private OutputStream openUploadStream(String targetfile) throws MalformedURLException, IOException
    URL url = null;
    //Creates a URL object with FTP protocol
    if (user == null)
    url = new URL("ftp://" + host + "/" + targetfile + ";type=i");
    else
    url = new URL("ftp://" + user + ":" + password + "@" + host + "/" + targetfile + ";type=i");
    urlc = url.openConnection();
    //Get the OutputStream that writes to this connection.
    OutputStream os = urlc.getOutputStream();
    return os;
    Now I need to find what the current directory is when the user logs in with username and password on to the FTP server in java.
    Thanks in Advance.

    as soon as user logs in he is taken to the directory
    "ftproot/pub/abc".
    now If I execute pwd command , is hould be able to
    get to know tht user is under "ftproot/pub/abc"Three respected posters, well two plus me ;-), have just told you otherwise. The information about the current directory is (a) secure and (b) useless to the user, as he can't do anything with it. The user doesn't want to know that at all and you shouldn't try to tell him. And in any case FTP doesn't support it, again for security reasons, so you can't do it.
    Just accept it.

  • Creating a workitem in the UWL from a java application

    Hi,
    I search a way to create a workitem in the UWL within a J2EE application. I doesn't found a open API for doing this. Do you found a way ?
    Regards,
    Gerald

    Hi,
    Have you read this SAP Note ? 921758
    "How to access the universal worklist integration API"
    Symptom
    You would like to integrate tasks and alerts from your non-SAP software through the central inbox in the SAP NetWeaver Enterprise Portal.    
    Patricio.

Maybe you are looking for

  • Replication of Business Partner Data from ECC to legacy

    Hi, My requirement is to replicate any changes made to Business Partner,should immediately get reflected in the legacy. Which is the best method to follow.I am planning to use ABAP proxies instead of IDOCS. As the replication needs to be immediate,Ca

  • Save For Web is not working

    I just had my software updated from CS to CS5 (I'm in a new job and asked for this upgrade) and now when I go to Save For Web I get the following: Error The operation could not be completed The system cannot find the path specified Notes: - This wasn

  • Can't print to PDF file

    After my old computer crashed, I have  installed and activated Acrobat 8 Standard on a new computer. On the old machine, I had been routinely printing to PDF files.  Now, when trying to print something to a PDF file, the print progress bar stops abou

  • Raising an alert at the end of process chain execution

    Hello ,   I have a requirement, where I have to raise an alert(not an e-mail) in Alert Server at the end of data loading process through a process chain. Is there solution for above requirement?. Regards MB

  • Application type in NACE

    hi,     Can any one tell me the application type (or description ) in NACE of          1) sales quantity contract          2) sales value contract thanks in advance , sg