OO Programming with Java


Packaging & jar

  1. If an archive can be opened with any zip tool, its content can be extracted with:
jar xf groups.jar

As a remark, the jar file contains META-INF/MANIFEST.MF that is an archive's descriptor (it specifies the main class, software components called beans, etc.). This file can be updated by using the m flag from the jar tool.

As a complement, it is possible to get information from bytcode by using the de-compiler javap used as follow:

javap chap2/Group
  1. Any other files can be embedded into the archive (e.g. doc) but this requires specific elements (ClassLoader and Resource) that will be described latter.

13 - 14