How to make JAR files using NetBeans IDE

These steps will allow you to create java executable that will run just by double clicking the file.
»Create JFrameForm with GUI swing components in a project in NetBeans IDE or Open a existing one.
»Run the file to check for any errors(Shift + F6).
»Now in the source code find the line public static void main(String args[]) {

» Copy the text under it till its closing brace.
» Now open the main class of the package in which the JFrameForm lies.
» In the main class find the same line as earlier and paste the text below it.
» Now Clean and build your main project
» Now locate the file (mostly in the dist folder of the Project).
» Double click the file to see it running…….!!!

//You can see a video tutorial for this on Videos Page

If this post helped you, just give your few seconds for sharing it and let others be helped too.

7 thoughts on “How to make JAR files using NetBeans IDE”

  1. @utsav You are in 11th or 12th?

    Are your files are placed in 'default package' , if yes create a new package and move your frame and main class to it using refactor.

    If still the problem persist,
    » Update your JRE to latest version
    » Ensure that there were no errors at compile time an try rebuolding your project

  2. YOu are the best.Your java works.thank you, they really helped me with my final year project since l'm new in java.

    can you please help me with my search engine.l want the code to display the search results from the database into a text field after pressing the search button.

    please help me.l have limited time to submit my final project.

    thank you for your assistance

  3. hello. I wanted to know if it is possible to create jar file of a netbean project if a mysql database has been attached to it. can it be done through the above mentioned process or should i use other embedded databases like java db or sqlite???

Leave a Comment

Your email address will not be published. Required fields are marked *