This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 195732 - Ability to include .jar libraries in built .jar output
Summary: Ability to include .jar libraries in built .jar output
Status: RESOLVED WONTFIX
Alias: None
Product: projects
Classification: Unclassified
Component: Libraries (show other bugs)
Version: 7.0
Hardware: PC All
: P3 normal (vote)
Assignee: Tomas Zezula
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-21 04:48 UTC by chunkyks
Modified: 2016-07-07 08:39 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description chunkyks 2011-02-21 04:48:24 UTC
I'm working on a project that makes use of several external libraries [for this project: sqlite-jdbc.jar from xerial, and jxl.jar from jexcelapi]. I simply have two .jar files included as external libraries.

I'd dearly love an option that would include the libraries, or the contents of them, into the build product. I'm not familiar enough with java to know what would actually be required, but I specifically want to be able to distribute a single .jar file to my customers that they can double click on, and use. 

Currently those extra libraries get copied into dist/lib, but that's still a lot of effort for end users.

I found this URL, but it still seems like something netbeans could usefully include:
http://www.java-forums.org/netbeans/12582-netbeans-creating-jar-including-jar-libraries.html
Comment 1 Tomas Zezula 2011-02-21 09:29:57 UTC
There are two possibilities.
The first is to unzip all jars, merge manifest, META-INF/service, etc and create an new jar file. The problem with such an approach is first the speed of build, second the problems with merging, signed jars, etc.
Another possibility is to use FatJar which is a jar with loader containing other jars. The loader provides a ClassLoader to load from the jars. In this solution custom ClassLoaders do not work.

This should not be done by default, but an extension module doing it can be created (with restriction listed above).
Comment 2 Jesse Glick 2011-02-24 23:14:39 UTC
Easily done from a Maven project. Probably WONTFIX for IDE-managed Ant-based projects.
Comment 3 Martin Balin 2016-07-07 08:39:15 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss