Java method to execute Eclipse's project at the command line

Source: Internet
Author: User


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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.