In eclipse, you can export a project as a jar file with the required libraries packaged in the same directory as the jar file in a separate folder. How exactly would I go about doing this in netbeans?
-
JEE project? Maven or ant based project? – BillRobertson42 Oct 31 '13 at 14:04
-
Using whatever the default is for Netbeans when it creates the build.xml, which I believe is ANT – Giardino Oct 31 '13 at 14:15
-
Use Maven's assembly plugin (if your project is Maven based) - http://maven.apache.org/plugins/maven-assembly-plugin/descriptor-refs.html#jar-with-dependencies. – Pavel Horal Oct 31 '13 at 14:35
-
Or maybe you want this - http://stackoverflow.com/questions/1751551/maven-how-to-export-project-with-sources-and-dependencies – Pavel Horal Oct 31 '13 at 14:36
1 Answers
When using at. Right click on the project and select "Build" that will create a jar file in the dist directory of your project. If you have specified a main in your project that entry will be there in the manifest file, so you can easily use it a self-executing jar file.
All of the jar files that it depends on will be placed in the dist/lib directory of your project. If you are using your jar file as a self-executing jar file it is important that those files exist in a lib directory under the place where your jar file exists (i.e. their locations are recorded in the manifest file relative to the location of the jar). I know this is true when you use relative locations for your jars, but it may not be true if you've specified absolution locations.

- 12,602
- 4
- 40
- 57