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 25376

Summary: ability to create various types of archives and to automatically include resources
Product: java Reporter: jnash67 <jnash67>
Component: ProjectAssignee: Tomas Zezula <tzezula>
Status: NEW ---    
Severity: blocker    
Priority: P3    
Version: 3.x   
Hardware: PC   
OS: Windows XP   
Issue Type: ENHANCEMENT Exception Reporter:
Bug Depends on:    
Bug Blocks: 41537    

Description jnash67 2002-07-07 18:44:00 UTC
JBuilder has a really nice archive builder that lets you 
build application, applet, webstart plus various 
additional types of archives. This isn't that difficult 
and often just involves changing the manifest.

Also, JBuilder lets you package resources including class 
files from other archives so that you just have a single 
archive. That way you can limit the number of jars you 
distribute, especially if you're only using a small subset 
of some jars. JBuilder also has the ability to do this 
automatically which should be relatively easily 
accomplished by looking at imports / fully-qualified 
references.

The jarbuilder is one area where netbeans lags 
significantly behind jbuilder.
Comment 1 Marek Grummich 2002-07-22 10:08:18 UTC
Set target milestone to TBD
Comment 2 Jesse Glick 2004-03-19 14:20:50 UTC
J2SE project type in trunk creates one kind of JAR; other project
types will permit others.

Leaving open for suggestions to (at the user's option):

1. Include JARs of required projects in main JAR.

2. Remove statically unreferenced classes.
Comment 3 Jesse Glick 2009-07-07 21:24:57 UTC
*** Issue 167067 has been marked as a duplicate of this issue. ***
Comment 4 Java4Me 2010-08-31 21:01:01 UTC
The current workaround for this is to use the instructions provided in this URL: http://java.sun.com/developer/technicalArticles/java_warehouse/single_jar/. This will package multiple libraries into a single JAR file. It won't package other resources like the original poster requested.

The problem with these instructions is that they don't work for projects without a main class. I have a shared library that I use among several of my applications. The shared library makes web service calls using JAX-RPC. I need the JAX-RPC libraries compiled into my shared library so that I only have to distribute one JAR. The instructions fail because NetBeans does not copy libraries to the lib folder if there is no main class.

I was able to modify the instructions to have my library compiled into a single JAR. I'm having one problem with it, but it is mostly working. The steps I used are detailed in this post: http://forums.netbeans.org/viewtopic.php?t=31059.

Please make sure that when this feature is added it also works for projects that do not have a main class.