If the API, jar package, or other ancillary resources provided by a third party are used in the development of the program. When you export and build your project's jar file, you must export the files of the third party, or it will not run correctly.
You can use the Fat jar plugin: http://sourceforge.net/projects/fjep/
1. Download
After the download is complete, unzip to the folder, structure
2. Installation
(1) Restart Eclipse by placing the jar package under plugin under Eclipse plugin.
(2) After reboot, windows->preferences, if there is a fat jar, indicates the installation is successful.
(3) If the fat jar is not seen in the preferences after reboot, go to configuration->org.eclipse.update in the Eclipse directory and delete the Platform.xml file. Then restart Eclipse.
After completing this step, Redo (2).
3. Use
Right-click the project and select Build Fat jar. Fill in the Jar name, select the main class of the project, and finally tick the resources you want to attach. Click Finish to complete the package.
4. Run the jar package
Open a Command window and enter the path of the jar package that you just packaged, enter:
Java-jar ***.jar
2017.5.1 using the Fat jar plug-in to package a project that references an external jar package