Fat jar Eclipse plug-in User Guide
Fat jar Eclipse plug-in:
Http://downloads.sourceforge.net/fjep/net.sf.fjep.fatjar_0.0.25.zip? Modtime = 1168127388 & big_mirror = 0
Installation:
SeeHttp://sapo2000.blog.163.com/blog/static/8832609200610724746676
Application:
Step 1:Create a Java Project
A. Create a Java project "demolib"
B. Add the package "demolib"
C. Add the class "demolib. Java ",CodeAs follows:
Package demolib; Public class demolib { Public static void sayhello (){ System. Out. println ("hello "); } } |
Step 2: Use the fat jar plug-in to generate a jar package
In package explorer, right-click the project "demolib" and select "+ build fat jar" Appears: "Demolib_fat.jar" is created under the root directory of the project.Click "Next" to select the. Class file to be included in the jar file.
Step 3: Create a Java Project
A. Create a Java project "demorun"
B. Right-click the project and choose Properties> JAVA build path> library> Add jar package "demolib/demolib_fat.jar"
Step 4: Create main class
A. Add the package "demorun"
B. Add the class "demorun. demorunmain. Java"
Package demorun; Import demolib. demolib; Public class demorunmain { Public static void main (string [] ARGs ){ Demolib. sayhello (); } } |
Step 5: Create a fat jar dialog
file-> export, and then select" + Fat jar exporter ". The following message is displayed: next select project: next Select Main class: finished! the file "demorun_fat.jar" has been generated under the project root directory and is used to save the configuration ". files ending with fatjar are also generated in the project root directory. The generated JAR file contains all the classes referenced by the jar package (demolib_fat.jar) and its own engineering class. This file can be executed anywhere without setting the classpath variable, because all necessary class libraries are extracted to "Fat jar.