Skip to main content  
        iSeries_home   |   EASY400     |   CGIDEV2     |   MMAIL  
Public-Source
 
Introduction
Command set 1
Command set 2
Appendix A
 Appendix B
 Download
 
 

 
Appendix B
Work with Qshell "jar" command

Though you do not need to know nor to practice it, you may still be interested about how Qshell command "jar" (Java Archive) works in its native mode.
Have a look at the ORACLE page for it.

  1. Command STRQSH (start QSH) has a CMD parameter. It allows to run a Qshell command.
    If you enter command STRQSH from the Command Entry screen without spacifying anything for the CMD parameter, you get to the Qshell Command Entry screen.
  2. Enter command jar without anything else. You will receive the help of this command, showing all its options:

You may then try the following sample commands. After installing this utility you may work with stream files a.txt and b.txt in IFS directory /zip/test.

Examples:

  1. jar -cvfM  /tmp/x.zip /zip/test/a.txt /zip/test/b.txt
    This command compresses into file /tmp/x.zip the following objects:
    • zip/test/a.txt
    • zip/css/
    • zip/css/css.css
    • zip/css/cssprint.css
    The compressed files maintain partially their directory paths.
    How to decompress this zipped file:
    1. Windows unzips the objects - with their directories- in a subdirectory of the directory hosting the zipped file.
    2. On IBMi
      • command jar -xvfM /tmp/x.zip and
      • command jar -xvf  /tmp/x.zip
      re-create the objects with their directories in the current directory ( usually directory /home/user_name ).
  2. jar -cvfMP /tmp/x.zip /zip/test/a.txt /zip/test/b.txt
    This command compresses into file /tmp/x.zip the following objects:
    • /zip/test/a.txt
    • /zip/css/
    • /zip/css/css.css
    • /zip/css/cssprint.css
    The compressed files maintain completely their directory paths.
    How to decompress this zipped file:
    1. Windows detects the compressed (zipped) file as invalid, whatever directory you load it.
    2. On IBMi
      • command jar -xvfMP /tmp/x.zip
        re-creates the objects with their directories in the root directory.
        In other words, every object is recreated exactly where it was.
      • command jar -xvfM  /tmp/x.zip
        re-creates the objects with their directories in the current directory ( usually directory /home/user_name ).
  3. jar -tvf /tmp/x.zip
    This command displays the table of contents of the zipped file.