How to execute a EXE file in java?

Hi!All
as title
Can I use Java to call any EXE file.
I need your help!!

~~~Use This~~~~
try{
Runtime rt = Runtime.getRuntime();
Process p = rt.exec(
"C:/Program
Program Files/InternetExplorer/IEXPLORE.EXE
http://192.168.1.101/index.jsp");
why has private IP there?
} catch (IOException e) {
e.printStackTrace();
}I and he want to a file which could run as .exe file.

Similar Messages

  • How to execute a .exe file in java(Jsp) without using a process ???

    Hi All ,
    How to execute a .exe file in Jsp without using a process ??? ...
    Is it Possiable ????

    itsdhanasaraa wrote:
    But as this a web application ... By using Runtime i'm getting some probs ..
    Let me guess, you want your web application to run a program on the client and to your surprise that's not working?
    Ain't gonna happen.
    its taking more time to execute .... that's y is there any other option to execute .exe file other than Runtime.getRuntime().exec("filename");Write proper English and you may be taken more seriously.
    1) it's not "taking more time to execute", whatever that's supposed to mean.
    2) there's no other way to execute something. Not that you should every use even that way anyway
    3) whenever you start thinking of executing external programs from Java, start thinking of not using Java in the first place.

  • How to execute one .exe file with as3 in air ?

    Hi
    How to execute one .exe file with as3 in air?
    I want do this work without fscommand .
    plize help me .

    itsdhanasaraa wrote:
    But as this a web application ... By using Runtime i'm getting some probs ..
    Let me guess, you want your web application to run a program on the client and to your surprise that's not working?
    Ain't gonna happen.
    its taking more time to execute .... that's y is there any other option to execute .exe file other than Runtime.getRuntime().exec("filename");Write proper English and you may be taken more seriously.
    1) it's not "taking more time to execute", whatever that's supposed to mean.
    2) there's no other way to execute something. Not that you should every use even that way anyway
    3) whenever you start thinking of executing external programs from Java, start thinking of not using Java in the first place.

  • How to create the exe file for java project.

    How to create the exe file for java project.
    am done the project in java swing , i like to create the project in exe format, so any one help for me,
    send the procedure for that.
    thanking u.

    How to create the exe file for java project.Have you ever heard of google? I pasted your exact "question" into a google search:
    http://www.google.com/search?q=How+to+create+the+exe+file+for+java+project.
    and got several useful links.
    Better search terms might yield even better results.
    Sheesh.

  • 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.

  • How to execute a exe file using javascript on app window.load.

    How to execute a exe file using javascript on app window.load.

    Hi sb00349044,
    As I have already mentioned in multiple replies to your previous questions, the SUMO forums focuses on providing help to end users with usage-questions and issues.
    For developer-related questions, please refer to one of the many resources readily available that I have linked to in the past:
    * [https://developer.mozilla.org/en-US/Firefox_OS MDN]
    * [http://stackoverflow.com/questions/tagged/firefox-os StackOverflow]
    * [https://lists.mozilla.org/listinfo Mozilla Mailing Lists]
    - Ralph

  • How to execute an external file in java ?

    How to execute an external file , where the file name of the external file is in unicode character. (i,e, may be in Chinese character).

    Process p = Runtime.getRuntime().exec("/path/to/executable");
    This is write. But my question is while the file name is in Chinese font.
    It means while a file name is in Chinese font or any unicode character that are supported by window but not in the command prompt. In this case the file name is changed to ??????.doc like.
    So, while trying to execute this it shows File not found message.

  • How to execute a .cmd file in java

    I can execute an .bat or a .exe file.
    But .cmd file is not getting executed in java.
    Pls tell me how to do this

    You can solve this problem by using the following method:
      private String[] getEnvironmentVariables() {
        final Map<String, String> env = System.getenv();
        final String[] result = new String[env.size()];
        final StringBuilder buf = new StringBuilder(100);
        int i = 0;
        for (Entry<String, String> e : env.entrySet()) {
          buf.setLength(0);
          result[i++] = buf.append(e.getKey()).append('=').append(e.getValue()).toString();
        return result;
      }You just have to execute your command like this now:
    Runtime.exec("cmd /C " + getMyCommand(), getEnvironmentVariables(), getMyExecDirectory());The reason why "start" didn't work is, that it is a command executed in a shell, thus you need "cmd /C" to execute start in the cmd. So you can do this as well:
    Runtime.exec("cmd /C start " + getMyCommand(), getEnvironmentVariables(), getMyExecDirectory());If you want to to execute "myCommand" in an own process.
    Kind Regards,
    Stefan Schubert

  • How can I call .exe file in java

    Hello,
    I want to call excutable files(.exe) in my java source code. How can I use the excutable files in java code.
    Thanks.
    Robin

    See java.lang.Runtime.exec()

  • How to kill a .exe file from java !!

    hi !!
    how can i avoid duplicate use of a .exe file in jva ! i mean how can i kill duplicated copies sothat i wan allow only one copy ( one use ) at once !!
    please help me

    A network port can only be used by one process at a time.
    So you can use this as a marker or lock to tell if your program
    is already running.
    It's a hack, and won't work if anyone else choses the same
    port you do, or if your program doesn't release the socket
    cleanly when it exits.
    amarshwren
    import java.io.IOException;
    import java.net.ServerSocket;
    public class SocketTest
    private static final int LOCK_PORT = 12345;
    // replace this method with whatever you really want to do
    private void doSomething()
    System.out.println("Pretending to do something...");
    try
    synchronized (this)
    while (true) this.wait();
    catch (InterruptedException ex)
    System.out.println("This won't happen.");
    public static void main (String args[])
    ServerSocket lockSocket = null;
    try
    lockSocket = new ServerSocket(LOCK_PORT);
    catch (IOException ex)
    System.err.println("An instance of SocketTest is already running.");
    System.exit(-1);
    SocketTest socketTest = new SocketTest();
    socketTest.doSomething();

  • How to display a .exe file in java applets by avoiding the file downloadbox

    Hi sir,
    I know that in order to display a any file(or)program in java applets you need to use showDocument().Where you cannot use exec() in java applets.
    My problem is that when i use showDocument() to display .exe file.It is showing a file download dialog box.If we click & open only it is opening that .exe file.Here i want to open the .exe file without showing that file download dialog box in java applets.
    Since,i am undergoing a project which involves it,it is quite urgent.pls.do provide the exact code in java applet without showing that file download dialog box.If it can't be done pls. do provide any other possibilities in order to be displayed on the browser.Thank U.
    Regards,
    m.ananthu

    Hi!
    I think you it's better to write a server socket program
    in server and open a socket connection to server socket then
    send exe file content via connection.
    (I guess you know applets only have permission to open socket connection to their code base)
    Bye!

  • How to create an exe file in java

    hi all,
    i am trying to create exe file for myapplication plz helpme out in this

    hi
    http://forum.java.sun.com/thread.jspa?forumID=57&threadID=5133369
    The answer is there in Last Post of this Thread
    Hope it will help you
    Thank you

  • How to do a exe file of java

    im going to download a program thats converts a java file into a exe, or more a whole project into a exe but how do i make a jar and how shall it lookslike inside the jar file, i think a jar file is type like compressed file so how do i do need quick help.

    http://www.excelsior-usa.com/jet.html
    http://www.ej-technologies.com/products/exe4j/overview.html
    http://jsmooth.sourceforge.net/
    Distributing your Application as an executable JAR file
    Google is your friend.

  • Which is the function to execute an .exe file in java

    in languages like c we can create .exe's of files.but in java we cant do that.
    i wanted to implement a software which i compiled in c using java.in c
    i created an .exe of the file and distributed it but in java i dont find any such
    method of creating exe as i would like to distribute the software.please help
    me out on this
    please also give me the name of the function using which i can exexute an
    .exe file

    No problem - it's just that I wanted to alert people to the fact that
    there was another thread. Otherwise It can get very confusing, very
    fast. (The CAPS were unnecessary, sorry about that.)
    Welcome to the forums!

  • Creation of exe file in java

    Hello friends,
    I am new to this forum. I want to know how to create an exe file in java. Is it possible to continue executing a jar file without java run time?

    Are you sure you want to do this?
    What is your reason for wanting no JRE? If it is speed then you will not get any.
    Would packaging the JRE + application in a single installer be acceptable?
    The guys at JET (a maker of a Java to native compiler) have written a good overview of your options.
    http://www.javalobby.org/articles/java2exe/

Maybe you are looking for

  • WF-Batch id needs to be changed on runtime with the user email id.

    Hi All, I have a requirement where i have to send an email through workflow, but in the from i have to pass the employee responsible email id. I got the email id in a container. Now how can i replace WF-Batch ( i.e. by default) with the user email id

  • Error message  "missing method body, or declare abstract"

    This is my test driver. Does anyone know why it is not working? public class TestInfo    public static void main(String args[])           Info results = new Info();           printInfo();      public static String printInfo();           System.out.pr

  • Problem with to_date('date_char') in a where clause

    A little confused with this plsql error. This code works... select to_date(value,'dd/mm/yy') from kip_lov where domain='MODULE START1' If I try to put the "to_date(value,'dd/mm/yy')" expression in the where clause I get an invalid year error, select

  • 10gR2 RAC, more 10gR2 RAC, DataGuard and Grid Control on Windows 2003

    Hello all, I have never used GC to implement DG between two different RAC installations, so if i could just a few questions to the experts. 1) It seems that the Grid Control GUI of the DG broker cannot created a RAC instance for physical/logical stan

  • Integration of Weblogic Server 10.3 and Spring 2.5

    Hello. I read that Weblogic 10.3 supports a Spring extension which allows Web component creation using Spring framework. http://e-docs.bea.com/wls/docs103/programming/spring.html#wp1079570 Has anybody tried this? In particuar, documentation says: "En