0

In my android library project, it references many jars, how do i export it in one jar? I have tried MANIFEST.MF Manifest-Version: 1.0 Class-Path: xxx.jar Main-Class: But it is not work!

Fang
  • 3,652
  • 4
  • 16
  • 30
  • 1
    http://stackoverflow.com/questions/423938/java-export-to-an-jar-file-in-eclipse – nobalG Jul 11 '14 at 07:35
  • Thank You! I mean, for instance, my package name is com.xxx.xxx, my reference jar is com.aaa.bbb, i want to export the jar is com xxx&aaa, just like copy the references jars file in my jar! – Fang Jul 12 '14 at 03:32

2 Answers2

0

Either from the context menu or from the menu bar's File menu, select Export.

1.Expand the Java node and select JAR file. Click Next

2.In the JAR File Specification page, select the resources that you want to export in the Select the resources to export field.

3.Select the appropriate checkbox to specify whether you want to Export generated class files and resources or Export Java source files and resources.

4.If there are other files or resources you want to include they must be in a an open project. Browse to their location via the directory tree on the left and ensure the file or resource is checked in the window on the right. In the example below we are including a file named OtherFile.txt which is located in the A3 directory.

5.In the Select the export destination field, either type or click Browse to select a location for the JAR file.

6.Select or clear the Compress the contents of the JAR file checkbox

7.Select or clear the Overwrite existing files without warning checkbox. If you clear this checkbox, then you will be prompted to confirm the replacement of each file that will be overwritten.

8.You have two options:

A.Click Finish to create the JAR file immediately
B.Click Next to use the JAR Packaging Options page to set advanced options, create a     JAR description, or change the default manifest. 

Go ahead and click finish.

9.Now, navigate to the location you specified for the jar. The icon you see and the behavior you get if you double click it will vary depending on how your computer is set up.

0

I found the answer, Use the eclipse plugin FatJar!

Fang
  • 3,652
  • 4
  • 16
  • 30