Creating Executable JAR File with NetBeans

Posted on June 16, 2009, under Programming

Here’s a quick guide on how to setup your NetBeans IDE to create an executable JAR file output. If you’re using JCreator to create JAR file, click here.

  1. Once you already created your Project using NetBeans IDE, right click the project name and click Properties.
  2. A new window will appear, the Project Properties. On the left side, click Packaging.
  3. The right panel will change and check Compress JAR File and Build JAR after compiling.
  4. JAR file saving location is indicated at the text box labeled Jar File.
  5. Then, Click OK. Now, compile your project and go to the saving location and try to click the JAR to execute your application.

You can see the sample window in the screen shot below for your guidance. Thanks!

NetBeans-IDE-Create-JAR-File

Click the image to enlarge.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Ping.fm
  • StumbleUpon
  • Suggest to Techmeme via Twitter
  • Technorati
  • Twitter
Tags: , , , ,

7 Responses to “Creating Executable JAR File with NetBeans”

  1. JC says:

    Neat!! Thanks bud

  2. safi says:

    thanks about information . i need this information because i don’t make jar file with netbeans IDE

  3. Jerome Locson says:

    @JC, @safi: You’re welcome! I hope that this small information helped you. :)

  4. Petter says:

    Thank you very much!!!!

  5. Foram says:

    I had created the related jar file in the above way, but while trying to run it with a double click, I m getting the following error message
    “could not find the main class:
    …\prjName\dist\jarFile.jar. Program will exit. ”

    So what might have been gone wrong. I had opened the jar file, like openwith javaw from the bin folder where my java is installed.

  6. Foram says:

    Infact I can execute the same from command line with javaw -jar jarFile.jar, but I want to execute it on double click!!!!!!

  7. Swetz says:

    I still dont find my jar file even after thoroughly following ur steps :(