How to Generate JAR File in Netbeans

Опубликовал Admin
2-10-2016, 18:10
836
0
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>".

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.
Теги:
Information
Users of Guests are not allowed to comment this publication.
ТОП Комментарии