Generate JAR File in Netbeans

Revision as of 05:36, 14 November 2016 by Kipkis (Kipkis | contribs) (importing article from wikihow)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Have you ever made an application in NetBeans and wanted to share it with your friends, but did not know how to put all the class files together in NetBeans? If so, this is the right tutorial for you!

Steps

  1. Open up NetBeans.
  2. Open Project Properties. Right click on the name of the project you want to generate a JAR file from, and select Properties from a drop down menu.
  3. Mark the Checkbox Compress JAR File. On your Properties window, look at the list of Categories on the left side. Go over to Build and under it should be Packaging, click on it. You should see Compress JAR File checkbox on the right, mark it.
  4. Confirm the Change. Press the OK button at the bottom right.
  5. Build your Project. There are several ways to it, but the easiest one is to press a button with an icon of a hammer next to the drop down menu for running configuration.
  6. Locate your JAR file. Most common one is in My Documents/NetBeansProjects, on Windows, and Home/NetBeansProjects folder, on Ubuntu (Linux). In case the folder isn't there, click on Help, select About and check under Userdir.
  7. Know How to Run It. Open up Command Prompt/Terminal or make a batch file that has this line included: java -jar "<name of jar file>".

Video

Tips

  • You can also check the README.txt file in Dist folder for more help about starting your JAR file.
  • By running the project (button that has green play icon), you build the project too.

Related Articles