GenJar : Java Glossary
home G words local find no local find frame, full screen Google search web for topic jump to footer translate with Babelfish 2008-02-03 by Roedy Green ©1996-2008 Canadian Mind Products
Go to : punctuation 0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z (all)
GenJar
An open source tool for tracking java dependencies. It builds jar files that automatically contain all the classes used directly or indirectly by the classes you explicitly include. You need this because jar.exe is not clever enough to do this on its own. It runs only as an ant task. It is a complex tool controlled with an XML script. It will also build an extended manifest describing all the elements. Of course it has no way of knowing about dynamically loaded classes or resources. The latest version is 1.0.2. On 2008-01-21, I determined it was last revised 2003-03-06 to fix exception message regression.

To use genjar:

  1. Extract the jar from the archive using WinZip.
  2. Copy genjar.jar to apache-ant-1.7.0\lib\. This is a one-time step.
  3. Compose your <genjar XML script and or incorporate it into an ant build.xml in the project directory with the class files where you want the jar built.
  4. CD to that project directory.
  5. Then run your script with:
    ant jar
Don’t use the genjar destdir option. It does not produce a simple list of dependencies to feed to jar.exe but rather a copy of the entire directory tree of classes that would go inside the jar.

Real Life Build Script

This build script builds Biorhythms, a signed Applet. You make genjar known no the script with: <taskdef resource="genjar.properties" /> Oddly there is no genjar.properties file anywhere. This is sufficient to look in GenJar.jar for Resource.class to define the syntax.
Here is how you would include a whole directory full of *.png resource images in your jar:
ant
Cramfull: ensure all resources included in jar
dependencies
jar.exe
xml

CMP_homejump to top
CMP logo
feedback Please email your feedback for publication, errors, omissions, broken/redirected link reports
and suggestions to improve this page to Roedy Green : feedback email
made with CSS
HTML Checked!
ICRA ratings logo
mindprod.com IP:[65.110.21.43]
Your face IP:[38.103.63.18] The information on this page is for non-military use only.
You are visitor number 7,153. Military use includes use by defence contractors.
You can get a fresh copy of this page from: or possibly from your local J: drive (Java virtual drive/Mindprod website mirror)
http://mindprod.com/jgloss/genjar.html J:\mindprod\jgloss\genjar.html