When running Eclipse's project on the command line, you need to build a jar package that can run on the command line, in two cases, one that is not a jar package in the project that calls a third party, which is simpler. There are also a lot of resources on the Internet, this article mainly describes the second case the project called the third-party jar package, there are two ways to generate the package:
method One: manually generate a "MANIFEST". MF " file and also need to write some information about what's going on: too complicated, and very easy to make mistakes, if you are interested please refer to the blog: http://www.cnblogs.com/lanxuezaipiao/p/ 3291641.html
method Two: simpler and less error-prone, is to install the Fat Jar plugin under Eclipse, detailed installation method:
1. The Eclipse Online Update method (note that Eclipse version4.4 has an error.) Manual installation required)
Help > Install New software > Add,
Name:fat Jar
Location:http://kurucz-grafika.de/fatjar
2. The Eclipse Plugin manual installation method
: http://downloads.sourceforge.net/fjep/net.sf.fjep.fatjar_0.0.27.zip?modtime=1195824818&big_mirror=0
Copy the files from the extracted plugins to the plugins folder in the Eclipse installation folder, and then restart Eclipse.
Note: The downloaded plugin is basically: net.sf.fjep.fatjar_0.0.31 version number, which supports all version numbers prior to eclipse4.4. :net.sf.fjep.fatjar_0.0.31 Version numberHowever, the eclipse4.4 version number is required: net.sf.fjep.fatjar_0.0.32 version number:net.sf.fjep.fatjar_0.0.32 Version number
Download the usage after successful installation:Step 1: Right-click the project project to select the Buile Fat Jar:
eclipse4.4 The version number above may appear (right click on Project to select Export, click Select Other)
Step 2: Configure the jar file to hold the folder, the main main file, etc., for example:
Step 3: Select the third-party jar package you want to use
Finally in the command line input: Java-jar Killcheatfans_fat.jar (note to be executed under the folder of the jar package)
Be sure to note the version of Eclipse
Java method to execute Eclipse's project at the command line