1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to Convert a .jar into .exe?

Discussion in 'General Programming Chat' started by irock97, Dec 10, 2011.

  1. irock97

    irock97 Junior Member

    Joined:
    May 30, 2011
    Messages:
    108
    Likes Received:
    53
    Howdy,

    I've codded a Java app , and would like to know how to run it. I've tried saving it as a .jar in Eclipse ; but it doesn't work.

    Thanks
     
  2. B.O.S.S

    B.O.S.S Power Member

    Joined:
    Dec 1, 2011
    Messages:
    539
    Likes Received:
    122
    Occupation:
    Social Media Marketeer
    Location:
    19.16.1:69
    Home Page:
    You may want to search for JarToExe Convert Wizard(v1.8) on google
     
  3. paincake

    paincake Power Member

    Joined:
    Aug 18, 2010
    Messages:
    716
    Likes Received:
    3,099
    Home Page:
    .jar is a standard extension for java executables. If you weren't able to launch your jar file, it means something was wrong with your app/compilation settings or you didn't have JRE (java runtime environment) installed on your machine.

    "converting" jar to an exe won't help much (the only difference will be the file extension) because you'll still need JRE to run your app.
     
  4. Chris22

    Chris22 Regular Member

    Joined:
    Sep 29, 2010
    Messages:
    400
    Likes Received:
    1,059
    It's probably because you're trying to save the project file instead of compiling the code.

    Once you have compiled you can use a java executable wrapper, this is good because it will detect if the correct java vm is installed on the end users computer and download/install the correct one.

    Code:
    http://jsmooth.sourceforge.net/
    There is one I found after a quick google search.

    Happy coding! :)
     
  5. zero-day

    zero-day Regular Member

    Joined:
    Aug 25, 2011
    Messages:
    349
    Likes Received:
    344
    Occupation:
    Coder
    Location:
    My Office.
    Home Page:
    Depending on your programming language of choice(other than Java) you could include the runtime files that are needed specifically for that file/project to run, have them drop to the machine, then run the program(the .jar).

    This can be done easily in Visual Basic, but you must know every single file that is needed to run .jar applications as well as any registry information that needs to be placed or edited.

    I have had to do such things in the past when I created custom installers for people's programs as well as my own, it's the same exact principal as the installer except the user doesn't have to confirm anything is going on(if the program you have is shady).

    If the program you have is shady, there is an API call in vb6, vb.net and I believe C++ called "URLDownloadToA" or you could just Shell() it and have it silently download the file(s) that are needed to run the program at hand. You could code it up so that it detects when the file(s) are done being downloaded fully then have it run the program(s) that you need it to.

    Now, this is a fairly technical thing to do if your pretty new to programming, and I would personally recommend doing it all in a Virtual Machine, so you don't accidentally screw up anything on your primary PC.

    Also, I would do this - have to virtual machines, one for coding the "dropper/downloader" and then another one thats a fresh, clean version of the version of Windows that you are targeting, from there, I would run the "dropper" in the fresh clean version of windows, but before you do that, make a copy of the Virtual Hard Drive and everything so you don't need to go through the setup again with windows, if it works it works, if not, you can just delete the "used copy" of Windows, and start fresh with the clean copy, and just keep doing copy, drop, test to make sure it all works to your expectations before going all out with it.
     
  6. hiderightnow

    hiderightnow Junior Member

    Joined:
    Jul 19, 2010
    Messages:
    104
    Likes Received:
    22