Whenever you build a standard Java project for which a main class is specified, the IDE automatically copies any JAR files on the project's classpath to the dist/lib folder. The IDE also adds each of the JAR files to the Class-Path element in the application JAR's manifest.mf file. This simplifies running the application outside the IDE.
Though the IDE copies the necessary files to the dist/lib directory automatically, the following special cases should be kept in mind:
Once you have distributed the archive of your application, the application can be run outside of the IDE from the command line.
To run an application JAR file from the command line:
java -jar <jar_name>.jar
When you run the jar command, the JAR tool uses the JAR manifest to determine the application entry point and the paths to the dependent binaries that are specified in the manifest.mf file.