Cebu Business I.T. Incubator

Creating Executable JAR File with NetBeans


Share







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.

You might also want to read...




Tags: , , , ,


  • JC

    Neat!! Thanks bud

  • JC

    Neat!! Thanks bud

  • http://www.bukalagi.blogspot.com safi

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

  • http://www.bukalagi.blogspot.com safi

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

  • Jerome Locson

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

  • Jerome Locson

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

  • http://www.0975335587.co.cc Petter

    Thank you very much!!!!

  • http://www.0975335587.co.cc Petter

    Thank you very much!!!!

  • Foram

    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:
    …prjNamedistjarFile.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.

  • Foram

    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.

  • Foram

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

  • Foram

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

  • Swetz

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

  • Swetz

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

  • Mariam Sioffy

    Thanx

  • Saint_luso

    where can i find dist/myjarfile.jar location?

  • http://www.jeromelocson.com Jerome Locson

    @Saint_luso: You can find it under your project folder after you compile it. Thanks.

  • http://pulse.yahoo.com/_DGKGSKHR3QCM66LBSITKBTJT4U Suvam Das

    I cannot find the jar file

  • http://www.jeromelocson.com Jerome Locson

    Hi Suvam, after clicking compile you will see a dist folder inside your project folder and there you can find the jar file.

  • Sunny

    in your project of netbeans,the dist folder is created….It is not shown in IDE window..U go through mycomputer/your projectname/dist…..

  • http://www.medicaltranscriptiontraining.in/ Medical Transcription Training

    Jar file is used for ?

  • http://www.rajorienindustries.com/ Foot Pedals

    Thanks for this article, It was a fantastic read which was extremely helpful.

  • Teenai

    got this error-”failed to load main-class manifest attribute from”….hope to get a reply soon

  • Yogeshsharma03

    thankssssssss

  • http://www.jeromelocson.com Jerome Locson

    You’re welcome!

  • Saafir01

    If you do not find a a jar file in your folder path of the program…try the following

                          * Choose Run > Clean and Build Main Project (Shift-F11)

  • Uneeshkrishnan

    thanks for your advise.

  • Bhanwar Sharma

     thanks for this useful information….

  • http://www.java-forums.org/netbeans/46265-how-embed-java-swing-into-html.html#post221328 How to embed java swing into a html

    [...] if (typeof ord=='undefined') {ord=Math.random()*10000000000000000;}document.write(''); What DarrylBurke said is correct. But there's a lot to read on those links but I did it at the end. Thanks. For beginners like me, go this link. It is more specific. Creating Executable JAR File with NetBeans | Jerome Locson [...]

  • Ganesh

    jar file is not created

  • Anonymous

    hey doing after this also i am unable to find that jar file .where is it located with what name?

  • http://twitter.com/vinci141 vinil

    i got it  thanks  man 

  • knoxtt

    This method also creates a ‘lib’ folder. What if you don’t want the lib folder, you just want a stand alone jar file? How do you do that?

  • Maddy

    Thanx………..

  • Bhanukolhe

    okey.. but file is not run-able…..What to do for that ??

    Bhanu Kolhe