One option for distributing your Java application is to make the JAR file (Java archive). Every Java archive contains a manifest file that describes the rest of the files in the archive. These are typically class files, security information, etc.
Creating of a Java archive is possible in the project tree in NetBeans IDE. Once you have created your project using NetBeans IDE, right-click the project name and select “Clean and Build”. The Java archive file will be created in the “dist” folder in the project directory. The dist folder might also contain a lib folder that you need to include.
Java archives are portable across platforms with the Java Runtime Environment (JRE) installed. JRE includes the language compiler, the library files and the Java Virtual Machine (JVM) that executes the Java application. If you created a GUI application, double-click the file icon to launch the program, and JVM handles the creation of the application’s window in an operating system environment. However, if you have created a console application, it is necessary to open a command line to run a command similar to: java -jar archive.jar.