Results 1 to 9 of 9
  1. #1
    heatblazer is offline Senior Member
    Join Date
    Nov 2012
    Posts
    136
    Rep Power
    0

    Lightbulb Java standalone executable

    Hello,
    I am wondering if there is an easy way to create a java exe(cutable) binary, by packing the JRE and ship it like a compiled C++ bin file? I know JAR is good but, I still prefer to create a standalone install - free exe, no matter if the user has or has not Java installed on her PC.

  2. #2
    jim829 is online now Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    3,413
    Rep Power
    5

    Default Re: Java standalone executable

    Not that I am aware. Even if you could, the JRE's are platform dependent so it would be limited to a particular OS. The whole point of the the JVM concept is so you don't have to do that. I would think that most platforms have a JRE installed.

    Regards,
    Jim
    The Java™ Tutorial | SSCCE | Java Naming Conventions
    Poor planning our your part does not constitute an emergency on my part.

  3. #3
    heatblazer is offline Senior Member
    Join Date
    Nov 2012
    Posts
    136
    Rep Power
    0

    Default Re: Java standalone executable

    What about JNC? I`ve tried it but I couldn`t set it up properly and nothing happened? Also, they are known as AOT compilers, however some are not free, others hard to set. So I was wondering is there a way to do it ( easy way ).

  4. #4
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,728
    Rep Power
    5

    Default Re: Java standalone executable

    There is such a feature built into the JDK nowadays, but its aimed at JavaFX2 applications.

    Deploying JavaFX Applications: Self-Contained Application Packaging | JavaFX 2 Tutorials and Documentation

    If Windows exe is your only concern, I have used JSmooth in the past and it works amazingly well. I don't know if you can setup a bundled JRE with it though. Alternatively you can simply look at the source code for the java.exe command and see how it manages things, then adapt that code to your own needs using for example Visual Studio Express to compile it all. The basic trick is to use the invocation API to bootstrap the JVM and then make it run a specific class.
    Last edited by gimbal2; 10-29-2013 at 11:41 AM.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  5. #5
    heatblazer is offline Senior Member
    Join Date
    Nov 2012
    Posts
    136
    Rep Power
    0

    Default Re: Java standalone executable

    Thanks, I`ll play a little with NetBeans, hope there is a way to make these with Eclipse too.

  6. #6
    heatblazer is offline Senior Member
    Join Date
    Nov 2012
    Posts
    136
    Rep Power
    0

    Default Re: Java standalone executable

    Sorry, JavaFX does not work for me. I have an existing Java swing code that I can`t turn to JavaFX now. However I`ve tested launch4j but still I can`t set it as standalone executable.

  7. #7
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,728
    Rep Power
    5

    Default Re: Java standalone executable

    "butfistic".

    ...

    That's just too funny. Sometimes spam can brighten your day.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  8. #8
    jashburn is offline Senior Member
    Join Date
    Feb 2014
    Posts
    219
    Rep Power
    1

    Default Re: Java standalone executable

    Launch4j - Cross-platform Java executable wrapper might be what you're looking for.

  9. #9
    kattoha is offline Member
    Join Date
    Apr 2014
    Posts
    4
    Rep Power
    0

    Default Re: Java standalone executable

    Quote Originally Posted by heatblazer View Post
    Hello,
    I am wondering if there is an easy way to create a java exe(cutable) binary, by packing the JRE and ship it like a compiled C++ bin file? I know JAR is good but, I still prefer to create a standalone install - free exe, no matter if the user has or has not Java installed on her PC.
    Try to use AOT comilator. It packs all libraries into 1 binary file. But there is no guaranty, that it will work faster.

Similar Threads

  1. Replies: 14
    Last Post: 08-04-2012, 12:08 AM
  2. How to develop a standalone application using java
    By santhoshkeleti in forum New To Java
    Replies: 2
    Last Post: 11-15-2011, 06:21 PM
  3. developing a standalone application using java
    By santhoshkeleti in forum New To Java
    Replies: 1
    Last Post: 11-15-2011, 06:18 PM
  4. java standalone to applet
    By Nikohw in forum Java Applets
    Replies: 1
    Last Post: 09-15-2009, 09:36 AM
  5. Replies: 4
    Last Post: 04-23-2009, 09:54 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •