Results 1 to 9 of 9
  1. #1
    radix is offline Member
    Join Date
    Nov 2008
    Posts
    10
    Rep Power
    0

    Default How to create exe file in java

    I'm sorry if this question already exist, I am new to java and I am using netbeans 6.1 and I don't know how to compile my project to exe file. Could anyone have any solution to this please.

  2. #2
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    9

    Default

    You don't. Java is not used to make native programs. Simply package it into a Jar.

    Lesson: Packaging Programs in JAR Files (The Java™ Tutorials > Deployment)

  3. #3
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

    Default

    Same question we've discuss several times here in our community. Search the forum, you can find lots of comments on this.

  4. #4
    radix is offline Member
    Join Date
    Nov 2008
    Posts
    10
    Rep Power
    0

    Default

    I know some program created in java like "Limewire" but how they created an exe file for their program?

  5. #5
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    9

    Default

    If you insist then Google for "exe builder" for Java. You have already been told thought, that that is not the way to go. You lose Java's cross-platform ability (which is one of it's largest draws), and any native program created from it will suffer in comparison to a native program created in a language designed to do so. So, you wind up with the worst of both worlds.

    Like I said, package it into a jarfile, using the tutorial I gave you. If you set up the manifest file right (which is described in the tutorial), and your system settings are correct, you can still execute it with a "double-click", which, I think, is your "real" concern.

  6. #6
    radix is offline Member
    Join Date
    Nov 2008
    Posts
    10
    Rep Power
    0

    Default

    Thank you very much for the info masijade I'm just curious how they do create their java file to exe. Now I know how to do, just I need a "Java Executable Wrapper". And I found this little app. "Launch4j"

    Once again thank you very much. :D

    Cheers!

  7. #7
    georgemc is offline Senior Member
    Join Date
    Sep 2008
    Posts
    135
    Rep Power
    0

    Default

    It's about time this "native executables are the only way to run software" myth was put to bed. If you knock up a quick shell script, you don't bother compiling it to a native binary. If you build a webapp you don't try and force it into an executable. Why people want to invest effort in making something appear to be something it isn't, for no actual benefit, is a mystery to me. A Java app runs inside a JVM, and there exist ways of packaging the software to exactly that end. Use them
    </rant>

  8. #8
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    9

    Default

    Quote Originally Posted by georgemc View Post
    If you build a webapp you don't try and force it into an executable.
    </rant>
    how to make exe file for jsp project - JSP

    ;-)

  9. #9
    georgemc is offline Senior Member
    Join Date
    Sep 2008
    Posts
    135
    Rep Power
    0

    Default

    Quote Originally Posted by masijade View Post
    Exactly my point :p

    There are always tools in existence to achieve these things, but that doesn't make it the right thing to do. For unfathomable reasons, people have this notion that unless something is bundled as a native executable, it's somehow not "proper" software

Similar Threads

  1. How to create a file
    By Alpha in forum New To Java
    Replies: 7
    Last Post: 01-06-2012, 08:10 PM
  2. How to create file on server?
    By thevoice in forum New To Java
    Replies: 10
    Last Post: 08-12-2010, 07:06 PM
  3. Replies: 20
    Last Post: 12-17-2007, 04:20 PM
  4. Replies: 1
    Last Post: 07-24-2007, 01:15 AM

Posting Permissions

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