Two ways to package Eclipse into a jar file_eclipse package Android add version number_CharliChen’s blog
This article is reproduced : http://www.cnblogs.com/lanxuezaipiao/p/3291641.html Option 1: Use the Export function that comes with Eclipse Step 1: Prepare the main manifest file “MANIFEST.MF”, Because it is a Java project that packages and references a third-party jar package, it needs to customize the configuration file MANIFEST.MF, and create a file MANIFEST.MF under this project, the content is as follows: Manifest-Version: 1.0 Class-Path: lib/commons-codec.jar lib/commons-httpclient-3.1.jar lib/commons-logging-1.1.jar lib/log4j-1.2.16.jar lib/jackson-all-1.8.5.jar Main-Class: main.KillCheatFans The first line is the version of MAINIFEST, the second line Class-Path specifies the location of the foreign jar package, and the third line specifies the MAIN java file we want to execute. A few points to note here: 1, Class-Path: and Main -Class: There is a space after it, which must be added, otherwise the packaging will fail, and the error message is: Invalid header field; 2. Assuming that our project is packaged as KillCheatFans.jar, then according to the above definition, a lib folder should be created in the same directory as KillCheatFans.jar (that is, the lib file and the packaged jar file in the same directory), and put the relevant jar package inside. Otherwise, an error of “Exception in thread “main” java.lang.NoClassDefFoundError” will appear; 3. Main-Class is followed by…