How to create .exe file of the java program you create?

This must be the qustions asked several time on the forums.So here it is again.
This sounds absurd to some developers here cause you'll say just create jar file and distributre to usr but sometimes there is not possiblity of having runtime environment in windows computers.So if we can bundle the enviroment and the setup together then packing into exe and then distribute like most of commercial java application sounds better.But the problem is how to do that?
Ok creating exe will increase the size but that doesn't matter,if there is any freeware tool to accomplish just that?

Check this out:
http://search.java.sun.com/search/java/index.jsp?qp=%2B
orum%3A31&nh=10&qt=create+exe+file+program&col=javaforu
s

Similar Messages

  • How to install .exe applications and the java on m...

    hi ! sorry if this has already been discussed but i wanted to know ~~~ how to install .exe applications and the java on my n9 ~~~ ... because i wanted to use plenty of other apps which are not supported  but these 2 would help fix the issue

    Is it stil not possible to install java applications on N9?
    Files containing JAD and JAR-ending in the file name.
    I am not familiar with Nokia N9 so I ask even if I suppose that JAR and JAD files are not able to install on a Nokia N9.
    Nokia 808 again (delight Belle), Nokia E7 and X7 ( again, all on Delight Belle...after some time on Nokia Lumia 925 (retired), 1020 (not that great)and Lumia 820 (Replaced my router at home, great for internet sharing).., N9 The best device ever (use it as much as Lumia 1020), Nokia 700 (Sport Phone/My Love :-) ) Nokia 701, Nokia E6 (Should have a follow-up from Nokia among with larger screen, NFC, Autofocus), Lumia 800 (Retired After 6 weeks), -Sports Tracker-Nokia Internet Radio-Handy Safe-Skype-Bambuser-Screenshot app pro-fMobi-ComingNext-Manual TaskSwitcher-jagiTimer-Easy StopWatch-Boldbeast-Equalizer-Financial Calculator-WiMP Music-YTasks-Davi-Thumbnail Folders-BizCalendar-Tiny7-Situations-nn reeder-Sport Timer-CameraLover-CameraPro-GrabRadio-LiveScore-Poddi-Gravity-SkyFilesPro

  • How to run an exe file in a java program

    Hi,
    Can somebody tell me how to run an exe file in a java program.
    Thank you!

    Yes, java.lang.Runtime.exec().
    Read this carefully before you do:
    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html
    Don't write a line of code before you're reviewed and understood the article completely. - MOD

  • How to Install .CAP file in the Java Card?

    Hi Friends..
    How to install *.CAP* file in the Java Card?..
    I've GPShell script as follows :
    mode_211
    enable_trace
    establish_context
    card_connect -readerNumber 2
    open_sc -security 1 -keyind 0 -keyver 0 -mac_key 404142434445464748494a4b4c4d4e4f -enc_key 404142434445464748494a4b4c4d4e4f
    install_for_load -pkgAID a00000006203010c01 -nvCodeLimit 500  -sdAID A000000003000000
    load -file HelloWorld.cap
    card_disconnect
    release_contextwith that script i can load HelloWorld.cap file successfully..
    Now, how to install the HelloWorld.cap file?..
    if i add script : load -file HelloWorld.cap i got this error :
    install -file HelloWorld.cap
    file name HelloWorld.cap
    Command --> 80E602001B09A00000006203010C0107A00000015100000006EF04C60201A80000
    Wrapped command --> 84E602002309A00000006203010C0107A00000015100000006EF04C60201
    A80030C859793049B85300
    Response <-- 6985
    install_for_load() returns 0x80206985 (6985: Command not allowed - Conditions of
    use not satisfied.)i ask this question because when i tried to select the applet through its AID, by this script :
    establish_context
    card_connect -readerNumber 2
    select -AID a00000006203010c0101i got this message error : select_application() returns 0x80216A82 (6A82: The application to be selected could not be found.)
    but there's exactly any that AID in my Java Card..
    here's is the list of AID from My Java Card :
    C:\GPShell-1.4.2>GPShell listgp211.txt
    mode_211
    enable_trace
    establish_context
    card_connect -readerNumber 3
    * reader name OMNIKEY CardMan 5x21-CL 0
    select -AID a000000003000000
    Command --> 00A4040008A000000003000000
    Wrapped command --> 00A4040008A000000003000000
    Response <-- 6F108408A000000003000000A5049F6501FF9000
    open_sc -security 1 -keyind 0 -keyver 0 -mac_key 404142434445464748494a4b4c4d4e4
    f -enc_key 404142434445464748494a4b4c4d4e4f // Open secure channel
    Command --> 80CA006600
    Wrapped command --> 80CA006600
    Response <-- 664C734A06072A864886FC6B01600C060A2A864886FC6B02020101630906072A864
    886FC6B03640B06092A864886FC6B040215650B06092B8510864864020102660C060A2B060104012
    A026E01029000
    Command --> 8050000008AAF7A87C6013BC0300
    Wrapped command --> 8050000008AAF7A87C6013BC0300
    Response <-- 0000715457173C2A8FC1FF0200937A55C288805D8F2A04CCD43FA7E69000
    Command --> 848201001023CA18742D36165ED992CFF2146C3D51
    Wrapped command --> 848201001023CA18742D36165ED992CFF2146C3D51
    Response <-- 9000
    get_status -element 10
    Command --> 80F21000024F0000
    Wrapped command --> 84F210000A4F004FF8BE1492F7275400
    Response <-- 0CF0544C00004D4F44554C415201000009A00000006203010C010100010AA000000
    06203010C01019000
    GP211_get_status() returned 2 items
    List of Ex. Load File (AID state Ex. Module AIDs)
    f0544c00004d4f44554c4152        1
    a00000006203010c01      1
            a00000006203010c0101
    card_disconnect
    release_contextPlease help me..
    And please correct me if i'm wrong,,
    Thanks in advance..

    Any suggestions for my question?..
    Please help me..
    Thanks in advance..

  • How to invoke the .bat(batch file ) from the java program

    i want to run some commands when i run one java program.
    I wrote those dos commands on the batch file and i want to include the bat file in the java program so that i can execute the bat file when i run the java program.
    tell me the way that i can run my bat file inside the java program.

    i tried this :
    a .bat file named test.bat, with this code : copy test.bat test2.bat
    a java class, Test.class, in the same directory
    public class Test {
         public static void main(String[] args) {
              try {           
                   Runtime rt = Runtime.getRuntime();
                   Process proc = rt.exec("cmd /c test.bat");
                   proc.waitFor();
                   int exitVal = proc.exitValue();
                   System.out.println("Process exitValue: " + exitVal);
              catch (Throwable t) {
                   t.printStackTrace();
    }

  • Create .exe file for core java project

    how can i create .exe file or wrapper for my core java project

    cotton.m wrote:
    To be honest with you this is going to be very difficult at best.
    And I'm not sure it's entirely realistic or legal. You'll need to install Tomcat and MySQL and all your stuff...Haven't ever tried doing so, but I think it might be quite possible sollution...
    There's a preconfigured version of Tomcat, that you simply unzip on the drive (so there's no nned of running installator).
    If OP would use some MySQL server's clone, that needs no installation (some time ago i was looking for thing like thatand found couple of those).
    All configuration (installing services etc.) as well as copying JSPs and other stuff to Tomcat dirs can be made with script files (.bat or whatever) or under another java application that will run all the commands...
    As cotton.m wrote... if it works, it's going to be hell lot of work...

  • How to run exe file from inside java

    I wan to run an exe file from inside java code. How can I do it?
    Thanks

    Hi Oakam
    This is very simple. Just go through the given code below
    in place of FILEANDPATHNAME just give the exe's path and name
    Note :- adding ".exe " is not necessary
    public class exep
    public static void main(String args[])
    Runtime r = Runtime.getRuntime();
    Process p = null;
    try{
    p = r.exec("FILEANDPATHNAME");
    catch(Exception e)
    Give ur feedback
    Thanx
    Ottran

  • Creating a file from a Java Program

    Hi all,
    if I want to store a byte array to a file somewhere in the middle of my program... is it possible to create the file inside my Java program, i.e. the file will be created during the execution of my program, and then write this byte array into it? The name of the file to be created is predefined by me, and not thru user input.
    If so, does anyone have a sample source code to show me? or redirect me to somewhere ?
    Thanks in advance!
    Joe

    You can take a look at the File, FileOutputStream, FileInputStream classes. A simple one will be like:
    byte[] ar = {12,13,14};
    File file = new File("wee.dat");
    if (!file.exists())
    try
    FileOutputStream fos = new FileOutputStream(file);
    fos.write(ar);
    }catch (IOException io){}
    else
    ...

  • How do I call another exe file from a Java program?

    Hi,
    I am doing a simple IDE (text editor/interpreter) for a simple programming language we are developing. It will be submitted as our project for this semester. I created an exe file (in C) which will be used as the interpreter. How do I call the interpreter from my IDE? The interpreter should run when the user clicks a button (i.e. the "Run" button). I've tried the Java Runtime class but it doesn't work. Anyone who knows how to do it?
    Thanks!

    I first tried to do a simple program that calls system commands such as dir, cd <dir>, etc.
    I do not have the exact code right now but as far as I can remember, here's what I wrote:
    class Sample{
        public static void main(String args[]) throws IOException{
           BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
           String command;
           while ((command = in.readLine()).equalsIgnoreCase("exit") == false){
              try{
                Runtime.getRuntime().exec(command);
              }catch(Exception e){
                 System.err.println("Error: " + e);
          System.exit(0);
    }

  • How do I run an exe file from a java program?

    I need to run an exe program from within a java program.
    what do I need to do this?
    thanks

    See java.lang.Runtime.exec()

  • Creation of a .exe file for a Java program

    hi, myself is venu.
    Can anyone help in creating a .exe file for a generated .class file.
    Thanking you in advance.
    bye

    Hello,
    There is a tool that you can download called JavaExe. It will make an executable of your java class. The class must have a main method. Just google for it and follow the instructions. I have tried it, it does work well.
    delaware_samurai

  • How to send a file from a java program to a servlet and get a response

    Hi,
    How can I call a servlet from a standalone java program and send a file to a servlet using POST method and in return gets the status back from the servlet. Any help is appreciated any small sample will help.
    Thanks.

    Hi,
    I am trying the following sample I got from net and am getting the following error. Any help what I am doing wrongs:
    06/12/24 02:15:58 org.apache.commons.fileupload.FileUploadBase$InvalidContentTypeException: the request doesn't contain a multipart/form-data or multipart/mixed stream, content type header is null
    06/12/24 02:15:58      at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:294)
    06/12/24 02:15:58      at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:268)
    06/12/24 02:15:58      at mypackage9.Servlet1.doPost(Servlet1.java:38)
    06/12/24 02:15:58      at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    06/12/24 02:15:58      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    06/12/24 02:15:58      at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
    06/12/24 02:15:58      at oracle.security.jazn.oc4j.JAZNFilter.doFilter(Unknown Source)
    06/12/24 02:15:58      at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:663)
    06/12/24 02:15:58      at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330)
    06/12/24 02:15:58      at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:830)
    06/12/24 02:15:58      at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:285)
    06/12/24 02:15:58      at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:126)
    06/12/24 02:15:58      at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
    06/12/24 02:15:58      at java.lang.Thread.run(Thread.java:534)Here is the sample client code:
    import org.apache.commons.httpclient.HttpClient;
    import org.apache.commons.httpclient.methods.PostMethod;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.IOException;
    public class PostAFile {
        private static String url =
             "http://192.168.0.17:8988/Vulcan_Materials-ServletPost2-context-root/servlet/Servlet1";
        public static void main(String[] args) throws IOException {
            HttpClient client = new HttpClient();
            PostMethod postMethod = new PostMethod(url);
            client.setConnectionTimeout(8000);
            File f = new File("C:\\load.txt");
            System.out.println("File Length = " + f.length());
            postMethod.setRequestBody(new FileInputStream(f));
            int statusCode1 = client.executeMethod(postMethod);
            System.out.println("statusLine>>>" + postMethod.getStatusLine());
            postMethod.releaseConnection();
    }Here is the sample servlet code:
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.PrintWriter;
    import java.io.IOException;
    import org.apache.commons.fileupload.DiskFileUpload;
    import org.apache.commons.fileupload.FileItem;
    import java.util.List;
    import java.util.Iterator;
    import java.io.File;
    public class Servlet1 extends HttpServlet
      private static final String CONTENT_TYPE = "text/html; charset=windows-1252";
      public void init(ServletConfig config) throws ServletException
        super.init(config);
      public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
        try
          response.setContentType(CONTENT_TYPE);
          PrintWriter out = response.getWriter();
          java.util.Enumeration e= request.getHeaderNames();
            while (e.hasMoreElements()) {
              String headerName=(String)e.nextElement();
              System.out.println(headerName +" = "+request.getHeader(headerName));
           //System.out.println("Content Type ="+request.getContentType());
            DiskFileUpload fu = new DiskFileUpload();
            // If file size exceeds, a FileUploadException will be thrown
            fu.setSizeMax(1000000);
            List fileItems = fu.parseRequest(request);
            Iterator itr = fileItems.iterator();
    System.out.println("***************************");
            while(itr.hasNext()) {
              FileItem fi = (FileItem)itr.next();
              //Check if not form field so as to only handle the file inputs
              //else condition handles the submit button input
              if(!fi.isFormField())
                System.out.println("\nNAME: "+fi.getName());
                System.out.println("SIZE: "+fi.getSize());
                //System.out.println(fi.getOutputStream().toString());
                File fNew= new File("C:\\", fi.getName());
                System.out.println(fNew.getAbsolutePath());
                fi.write(fNew);
              else
                System.out.println("Field ="+fi.getFieldName());
            out.println("SUCCESS123456: ");
          out.close();
        catch(Exception e)
          e.printStackTrace();
    }Any help on what is wrong.
    Thanks

  • How to execute unix command from the Java program running on Windows

    Hello,
    I need to
    1. Execute a unix shell script from a Java program running on the Windows.
    2. I also need to capture the output of this shell script in my program.
    Please suggest me how to achieve this.
    Thanks in Advance.

    Hi...
    Something is missing here
    If you want to execute a shell script in windows that not posible unless you find or develop a unix shell script parser for windows.
    But if you are trying the execute a unix shell script on a remote unix computer from your java program running on a windows platform you can do that by logging on to the UNIX terminal which is running on port 23 I think.
    You can test this using telnet tool on windows
    just type on command prompt
    telnet <ip of the unix pc> <port number this case 23>
    you should get the unix terminal. If that works you can do the same through java or you can directly conect to port 23 of that pc using sockets that way your program will be platform independant

  • How to execute *.BAT file from  the Java Application

    Hello to all.
    I wants to run *.BAT file form my applicaion.
    Can u give the code of that two-four line,please
    Wating four your replay.
    Yours Friend
    Bhavin Shah.....

    pr = rt.exec("cmd.exe /c start " + yourProgramName)The exec() method executes the command you specify in the argument and returns a process. In this example, it's telling Windows to run "yourProgramName".
    HTH

  • How to open a file with the assosiate program on suse????

    i came to know that we can open a file with assosiated program on windows using "cmd /c start filename".
    and i want the same functionality on suse linux.
    in forums i found that "kfm filename" will do fine on linux.
    i tried it on suse but no use at all.
    i would appretiate the quick response and i would be very thankful
    for the same.
    Thanks alot in advance.

    take a look at java.awt.Desktop in the JDK SE 6 http://java.sun.com/javase/6/docs/api/java/awt/Desktop.html.
    See these two methods:
    - void edit(File file)
    - void open(File file)

Maybe you are looking for