How to create executable jar in NetBeans IDE

Discussion in 'Java' started by semi, Feb 25, 2005.

  1. semi

    semi Guest

    I used to use Jbuilder for JAVA development. In Jbuilder, I was able
    to create executabe jar that has all the libraries in and run on its
    own. How do you create same kind of executable jar with NetBeans?

    Thanks in advance,

    Seung
    semi, Feb 25, 2005
    #1
    1. Advertising

  2. > I used to use Jbuilder for JAVA development. In Jbuilder, I was able
    > to create executabe jar that has all the libraries in and run on its
    > own. How do you create same kind of executable jar with NetBeans?


    I do it with an ant script. I hope someone can tell me how to do it with
    three mouseclicks...
    Karel Suikers, Feb 25, 2005
    #2
    1. Advertising

  3. semi

    Oscar kind Guest

    Karel Suikers <> wrote:
    >> I used to use Jbuilder for JAVA development. In Jbuilder, I was able
    >> to create executabe jar that has all the libraries in and run on its
    >> own. How do you create same kind of executable jar with NetBeans?

    >
    > I do it with an ant script. I hope someone can tell me how to do it with
    > three mouseclicks...


    In my IDE, I use two mouse clicks (sorry, not three). These mouse clicks
    start ANT using a similar build script.

    Many IDE's provide ANT support these days, of which JBuilder is one
    (IIRC). I know for certain that Eclipse and IntelliJ do.


    --
    Oscar Kind http://home.hccnet.nl/okind/
    Software Developer for contact information, see website

    PGP Key fingerprint: 91F3 6C72 F465 5E98 C246 61D9 2C32 8E24 097B B4E2
    Oscar kind, Feb 25, 2005
    #3
  4. "Oscar kind" <> schrieb im Newsbeitrag
    news:eek:...
    > Karel Suikers <> wrote:
    >>> I used to use Jbuilder for JAVA development. In Jbuilder, I was able
    >>> to create executabe jar that has all the libraries in and run on its
    >>> own. How do you create same kind of executable jar with NetBeans?

    >>
    >> I do it with an ant script. I hope someone can tell me how to do it with
    >> three mouseclicks...

    >
    > In my IDE, I use two mouse clicks (sorry, not three). These mouse clicks
    > start ANT using a similar build script.
    >
    > Many IDE's provide ANT support these days, of which JBuilder is one
    > (IIRC). I know for certain that Eclipse and IntelliJ do.
    >


    In Eclipse you can use the Fat-Jar Eclipse Plug-In
    http://fjep.sourceforge.net .
    This plugin allows building an executable jar file containing all referenced
    jars,
    classes and subproject. The information is gathered from the project
    classpath.
    After you have configured and saved the settings for a project (Main-Class.
    ....),
    you can rebuild the "Fat-Jar" with one mouse-click: Right-Click on the
    settings -> Fat-Jar -> Quick-Build :)
    Also you can export the current settings as an ANT script.

    Best regards,

    feri
    Ferenc Hechler, Feb 26, 2005
    #4
  5. semi

    tha_specializt

    Joined:
    Dec 20, 2007
    Messages:
    1
    Netbeans!

    Why use a Eclipse if you can use a well-suited, fast and optimized out-of-the-box-IDE?
    Easy as pie: (Netbeans 5.5)

    right-click your project,
    "set main project",
    select your project,
    "File",
    "PROJECTNAME Properties",
    "Run",
    set your main class,
    "Libraries",
    "Add JAR/Folder",
    select your wanted libs,
    do a CLEAN build,
    enter the build-path,
    enter /dist and be amazed --> DONE!

    No Modifications/Hacks/buggy DiY-IDE´s, no cry :flute:
    tha_specializt, Dec 20, 2007
    #5
  6. semi

    ruggershawn

    Joined:
    Jan 30, 2008
    Messages:
    1
    Do you know how to create a Jar in Netbeans that includes all dependencies?
    ruggershawn, Jan 30, 2008
    #6
  7. semi

    AndreNTX

    Joined:
    Feb 19, 2010
    Messages:
    1
    Thanks!

    Many thanks to "tha_specializt" for his post.
    AndreNTX, Feb 19, 2010
    #7
  8. semi

    buggirl

    Joined:
    Dec 14, 2011
    Messages:
    1

    Hi, this sounded so good. I have had so much trouble with this. I just can't seem to get my jar file runnable. I have followed you steps, I do my clean and build, but when I try to run it from the dist folder is still doesn't work..! I think I might not add the right "libs".. what do you mean exactly by this? Sorry, I am very new to Java and netbeans...!
    buggirl, Dec 14, 2011
    #8
  9. semi

    jvjv

    Joined:
    May 3, 2012
    Messages:
    1
    very clear and simple tha_specializt.. thank you
    jvjv, May 3, 2012
    #9
  10. semi

    educatedmonkey

    Joined:
    Sep 21, 2012
    Messages:
    1
    thankyou

    thanks just what i was looking for
    educatedmonkey, Sep 21, 2012
    #10
  11. semi

    john kisakye

    Joined:
    Jun 21, 2013
    Messages:
    1
    press SHIFT + F11 to make an executable .jar file
    john kisakye, Jun 21, 2013
    #11
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mark Haag
    Replies:
    1
    Views:
    4,544
    Christophe Vanfleteren
    Sep 17, 2003
  2. Pimousse
    Replies:
    2
    Views:
    3,620
    Roedy Green
    Apr 21, 2004
  3. PhilBray
    Replies:
    3
    Views:
    930
    Oliver Wong
    Sep 19, 2006
  4. Jason Cavett
    Replies:
    8
    Views:
    606
    Sanjay
    May 16, 2007
  5. Replies:
    0
    Views:
    425
Loading...

Share This Page