Generate Jar in netbeans 7.1

S Karthik picture S Karthik · Jan 23, 2012 · Viewed 8k times · Source

I am using netbeans 7.1 (new to it). I would like to know how to export our projects as a .jar file (though I have searched a lot in Internet).

Many times ./dist folder itself is not created, even though it is created, I see only .zip files (not jar). It would be great if one can help me out in this aspect. Seems like in earlier version of netbeans, the jar would be available in ./dist folder.

Answer

COD3BOY picture COD3BOY · Jan 23, 2012

Do this before search :) (right click the project > Clean and Build)

enter image description here


When you use the Clean and Build command, the IDE runs a build script that performs the following tasks:

  • Deletes any previously compiled files and other build outputs.
  • Recompiles the application and builds a JAR file containing the compiled files.

There is no difference in Netbeans 7.1, the jar will be in the dist folder :)