The runnabel JAR contains a MANIFEST.MF file, which defines the Main class to be executed when the JAR is run.
Non-runnable JARs are just libraries of classes, that can be added to the classpath so that code is reuable. (It also contains the manifest file, but no main classes there).
On how to export a JAR file or a runnable JAR file please check the link below:
http://help.eclipse.org/neon/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Ftasks%2Ftasks-37.htm
Example on how to export a runnable JAR file:
- Right Click on the project, and click on Export
- Select Runnable JAR file under Java, and click Next
- set Lauch configurations to the class which contains the Main function;
set Export destination; and click Finish
You can check the JAR file with 7-zip, and the MANIFEST.MF file under META-INF folder.
It contains the class path to Main function while executing the JAR file.
Manifest-Version: 1.0
Class-Path: .
Main-Class: org.eclipse.jetty.embedded.FileServer