123 lines
7.6 KiB
HTML
123 lines
7.6 KiB
HTML
|
<?xml version="1.0" encoding="UTF-8"?>
|
||
|
<!DOCTYPE html
|
||
|
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||
|
<html lang="en-us" xml:lang="en-us">
|
||
|
<head>
|
||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||
|
<meta name="security" content="public" />
|
||
|
<meta name="Robots" content="index,follow" />
|
||
|
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
|
||
|
<meta name="DC.Type" content="reference" />
|
||
|
<meta name="DC.Title" content="AS400ToolboxJarMaker" />
|
||
|
<meta name="abstract" content="While the JAR file format was designed to speed up the downloading of Java program files, the AS400ToolboxJarMaker generates an even faster loading IBM Toolbox for Java JAR file through its ability to create a smaller JAR file from a larger one." />
|
||
|
<meta name="description" content="While the JAR file format was designed to speed up the downloading of Java program files, the AS400ToolboxJarMaker generates an even faster loading IBM Toolbox for Java JAR file through its ability to create a smaller JAR file from a larger one." />
|
||
|
<meta name="DC.Relation" scheme="URI" content="progtips.htm" />
|
||
|
<meta name="copyright" content="(C) Copyright IBM Corporation 2006" />
|
||
|
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 2006" />
|
||
|
<meta name="DC.Format" content="XHTML" />
|
||
|
<meta name="DC.Identifier" content="jar" />
|
||
|
<meta name="DC.Language" content="en-us" />
|
||
|
<!-- All rights reserved. Licensed Materials Property of IBM -->
|
||
|
<!-- US Government Users Restricted Rights -->
|
||
|
<!-- Use, duplication or disclosure restricted by -->
|
||
|
<!-- GSA ADP Schedule Contract with IBM Corp. -->
|
||
|
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
|
||
|
<link rel="stylesheet" type="text/css" href="./ic.css" />
|
||
|
<title>AS400ToolboxJarMaker</title>
|
||
|
</head>
|
||
|
<body id="jar"><a name="jar"><!-- --></a>
|
||
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
||
|
<h1 class="topictitle1">AS400ToolboxJarMaker</h1>
|
||
|
<div><p>While the JAR file format was designed to speed up the downloading
|
||
|
of Java™ program
|
||
|
files, the AS400ToolboxJarMaker generates an even faster loading IBM<sup>®</sup> Toolbox for Java JAR
|
||
|
file through its ability to create a smaller JAR file from a larger one.</p>
|
||
|
<div class="section"><p><a href="javadoc/utilities/JarMaker.html">AS400ToolboxJarMaker
|
||
|
class</a> </p>
|
||
|
<p>Also, the AS400ToolboxJarMaker class can unzip a JAR file
|
||
|
for you to gain access to the individual content files for basic use.</p>
|
||
|
</div>
|
||
|
<div class="section"><h4 class="sectiontitle">Flexibility of AS400ToolboxJarMaker</h4><p>All of the AS400ToolboxJarMaker
|
||
|
functions are performed with the JarMaker class and the AS400ToolboxJarMaker
|
||
|
subclass:</p>
|
||
|
<ul><li>The generic <a href="javadoc/utilities/JarMaker.html">JarMaker</a> tool operates on any JAR or Zip file; it splits
|
||
|
a jar file or reduces the size of a jar file by removing classes that are
|
||
|
not used.</li>
|
||
|
<li>The <a href="javadoc/utilities/AS400ToolboxJarMaker.html">AS400ToolboxJarMaker</a> customizes and extends JarMaker
|
||
|
functions for easier use with IBM Toolbox for Java JAR files.</li>
|
||
|
</ul>
|
||
|
<p>According to your needs, you can invoke the AS400ToolboxJarMaker methods
|
||
|
from within your own Java program or from a command line. Call
|
||
|
AS400ToolboxJarMaker from the command line by using the following syntax:</p>
|
||
|
<pre> java utilities.JarMaker [options]</pre>
|
||
|
<p>where</p>
|
||
|
<ul><li>options = one or more of the available options</li>
|
||
|
</ul>
|
||
|
<p>For a complete set of options available to run at a command line prompt,
|
||
|
see the following:</p>
|
||
|
<ul><li><a href="javadoc/utilities/JarMaker.html#JMOPTIONS">Options</a> for
|
||
|
the JarMaker base class</li>
|
||
|
<li><a href="javadoc/utilities/AS400ToolboxJarMaker.html#ASOPTIONS">Extended options</a> for the AS00ToolboxJarMaker subclass</li>
|
||
|
</ul>
|
||
|
</div>
|
||
|
<div class="section"><h4 class="sectiontitle">Using AS400ToolboxJarMaker</h4><p>You can use AS400ToolboxJarMaker
|
||
|
to work with JAR files in several ways:</p>
|
||
|
<ul><li>Uncompress one file bundled within a JAR file</li>
|
||
|
<li>Split a large JAR file into smaller JAR files</li>
|
||
|
<li>Exclude any IBM Toolbox
|
||
|
for Java files
|
||
|
that your application does not need to run</li>
|
||
|
</ul>
|
||
|
</div>
|
||
|
<div class="section"><p><strong>Uncompressing a JAR file</strong></p>
|
||
|
<p>Suppose you wanted to uncompress
|
||
|
just one file bundled within a JAR file. AS400ToolboxJarMaker allows you to
|
||
|
expand the file into one of the following:</p>
|
||
|
<ul><li>Current directory (<a href="javadoc/utilities/JarMaker.html#EXTRACT(JAVA.IO.FILE)">extract(jarFile)</a>)</li>
|
||
|
<li>Another directory (<a href="javadoc/utilities/JarMaker.html#EXTRACT(JAVA.IO.FILE, JAVA.IO.FILE)">extract(jarFile, outputDirectory)</a>)</li>
|
||
|
</ul>
|
||
|
<p id="jar__extracting"><a name="jar__extracting"><!-- --></a>For example, with the following code, you are extracting
|
||
|
AS400.class and all of its dependent classes from jt400.jar:</p>
|
||
|
<pre> java utilities.AS400ToolboxJarMaker -source jt400.jar
|
||
|
-extract outputDir
|
||
|
-requiredFile com/ibm/as400/access/AS400.class</pre>
|
||
|
</div>
|
||
|
<div class="section"><p><strong>Splitting up a single JAR file into multiple, smaller JAR files</strong></p>
|
||
|
<p>Suppose
|
||
|
you wanted to split up a large JAR file into smaller JAR files, according
|
||
|
to your preference for maximum JAR file size. AS400ToolboxJarMaker, accordingly,
|
||
|
provides you with the <a href="javadoc/utilities/JarMaker.html#SPLIT(JAVA.IO.FILE, INT)"> split(jarFile, splitSize)</a> function.</p>
|
||
|
<p id="jar__split"><a name="jar__split"><!-- --></a>In
|
||
|
the following code, jt400.jar is split into a set of smaller JAR files, none
|
||
|
larger than 300KB:</p>
|
||
|
<pre> java utilities.AS400ToolboxJarMaker -split 300</pre>
|
||
|
</div>
|
||
|
<div class="section"><p><strong>Removing unused files from a JAR file</strong></p>
|
||
|
<p>With <a href="javadoc/utilities/AS400ToolboxJarMaker.html">AS400ToolboxJarMaker</a>,
|
||
|
you can exclude any IBM Toolbox for Java files not needed by your application
|
||
|
by selecting only the IBM Toolbox for Java <a href="componentlist.htm#componentlist">components</a>,
|
||
|
languages, and <a href="ccsidlist.htm#ccsidlist">CCSIDs</a> that you
|
||
|
need to make your application run. AS400ToolboxJarMaker also provides you
|
||
|
with the option of including or excluding the JavaBean files associated with
|
||
|
the components you select. </p>
|
||
|
<p id="jar__removing"><a name="jar__removing"><!-- --></a>For example, the following
|
||
|
command creates a JAR file that contains only those IBM Toolbox for Java classes needed to make the CommandCall
|
||
|
and ProgramCall components of the IBM Toolbox for Java work:</p>
|
||
|
<pre> java utilities.AS400ToolboxJarMaker -component CommandCall,ProgramCall</pre>
|
||
|
<p id="jar__omitconv"><a name="jar__omitconv"><!-- --></a>Additionally, if it is unnecessary to convert text strings
|
||
|
between Unicode and the double byte character set (DBCS) conversion tables,
|
||
|
you can create a 400KB byte smaller JAR file by omitting the unneeded conversion
|
||
|
tables with the -ccsid option:</p>
|
||
|
<pre> java utilities.AS400ToolboxJarMaker -component CommandCall,ProgramCall -ccsid 61952</pre>
|
||
|
<div class="note"><span class="notetitle">Note:</span> Conversion classes are not included with the program call classes. When
|
||
|
including program call classes, you must also explicitly include the conversion
|
||
|
classes used by your program by using the -ccsid option.</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div>
|
||
|
<div class="familylinks">
|
||
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="progtips.htm" title="This section features a variety of tips that can help you use IBM Toolbox for Java.">Tips for programming</a></div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</body>
|
||
|
</html>
|