Saber Mhadhbi Saber Mhadhbi - 1 year ago 112
Java Question

How to create jar from many java class using netbeans?

I have a java package with many java class and many main. i wish to make jar from these package ? can you help me please ?
(i work with netbeans )

Answer Source

If the project is under netbeans IDE, you should follow these steps:

  • Right click on the project and then click on Properties

  • Click on Packaging

  • Click on Compress JAR File

  • Accept changes, click OK

  • Right click on the project and then click on Clean and Build

  • Go to the directory where your project is stored

  • Look in the dist folder for the JAR file

    To select the main class that will be executed

  • Click on Run

  • Click on Browse near to Main Class label

    enter image description here

    EDIT :

    If you are using netbeans under windows, and if the jar file does not generate any output, try the following command in cmd :

    start /b <jar file>

    Then an error should appear

    So you can know what is the problem

  • Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download