Exporting Jar files
I am using Eclipse & have some packages that I want to export into a JAR file (not a runnable ones). I just need it so I can import it into another Java project to use the classes.
When I exported them, most of the packages are exported but there are a few packages that appears to be empty. I've selected Export generated class files and resources
and Export Java source files and resources
. I also tried changing the option here and there just to figure it out but it still gives me the same results.
Is there a configuration that I missed?开发者_运维知识库
You would probably be better off reusing Clean way to combine multiple jars? Preferably using Ant (that's what Eclipse is trying to do, under the scenes).
When you right click on a project, then pick Export ...
you can in the following menu choose Export as Java>JAR File
.
Then a menu should pop up, which lets you exactly choose from a list which folders/files you want to export into the JAR. (On the left, as Select the resources to export
.)
For exporting...
1. Goto File -> Export.
2. Under 'General' category select 'Archive File'.
3. Give name and path for where to save the archive.
For importing...
1. Goto File -> Import.
2. Under 'General' category select 'Archive File'.
3. Browse the exported archive.
精彩评论