Java methods to run the Eclipse project on the command line

Source: Internet
Author: User


When you run Eclipse's project on the command line, you need to generate a jar package that can be executed, which can be executed at the command line, and in two cases, a jar package that does not call a third party in the project, which is relatively simple and has a lot of resources on the web. This article focuses on the second case the project called a third-party jar package, and 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 complex, and extremely error-prone, if interested please refer to the blog: http://www.cnblogs.com/lanxuezaipiao/p/3291641. HTML

method Two: simple and error-prone, is to install the Fat Jar plug-in under Eclipse, the specific installation method:

1. Eclipse Online Update method (note the Eclipse version number,Eclipse4.4 Error, need to install manually)
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 directory in the Eclipse installation directory, and then restart Eclipse.

Note: The downloaded plugin is basically: the net.sf.fjep.fatjar_0.0.31 version, which supports all versions prior to eclipse4.4. :net.sf.fjep.fatjar_0.0.31 versionHowever, the eclipse4.4 version requires: net.sf.fjep.fatjar_0.0.32 version,:net.sf.fjep.fatjar_0.0.32 version
How to use the download after successful installation:Step 1: Right-click Project selection buile Fat Jar:       


eclipse4.4 The above version may appear (right click on the project to select Export, click Select Other)


Step 2: Configure the jar file storage directory, main main file, etc., such as:  


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 run in the directory of the Jar package)

Be sure to note the version number of Eclipse






Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Java methods to run the Eclipse project on 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.