ibm-information-center/dist/eclipse/plugins/i5OS.ic.cl_5.4.0.1/crtjvapgm.htm

430 lines
20 KiB
HTML
Raw Normal View History

2024-04-02 14:02:31 +00:00
<!doctype html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head><META http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Create Java Program (CRTJVAPGM)</title>
<link rel="stylesheet" type="text/css" href="../rzahg/ic.css">
</head>
<body bgcolor="white">
<script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<a name="CRTJVAPGM.Top_Of_Page"></a>
<h2>Create Java Program (CRTJVAPGM)</h2>
<table width="100%">
<tr>
<td valign="top" align="left"><b>Where allowed to run: </b>All environments (*ALL)<br>
<b>Threadsafe: </b>No
</td>
<td valign="top" align="right">
<a href="#CRTJVAPGM.PARAMETERS.TABLE">Parameters</a><br>
<a href="#CRTJVAPGM.COMMAND.EXAMPLES">Examples</a><br>
<a href="#CRTJVAPGM.ERROR.MESSAGES">Error messages</a></td>
</tr>
</table>
<div> <a name="CRTJVAPGM"></a>
<p>The Create Java Program (CRTJVAPGM) command creates a Java program from a Java class file, JAR file, or ZIP file. The resulting Java program object becomes part of the class file, JAR file or ZIP file object. The Java program runs when started by the JAVA (Run Java Program) command. The size and performance of the Java program can be controlled through use of the OPTIMIZE and LICOPT parameters.
</p>
<p>If a JAR file or ZIP file is specified, only one Java program is created and associated with this file. The Java program contains an optimized internal form for all of the classes in the JAR file or ZIP file.
</p>
<p><b>Restrictions:</b> The file must be in one of the following file systems: QOpenSys,"root", or a user-defined file system.
</p>
</div>
<table width="100%">
<tr><td align="right"><a href="#CRTJVAPGM.Top_Of_Page">Top</a></td></tr>
</table>
<hr size="2" width="100%">
<div>
<h3><a name="CRTJVAPGM.PARAMETERS.TABLE">Parameters</a></h3>
<table border="1" cellpadding="4" cellspacing="0">
<!-- col1="10" col2="15" col3="30" col4="10" -->
<tr>
<th bgcolor="aqua" valign="bottom" align="left">Keyword</th>
<th bgcolor="aqua" valign="bottom" align="left">Description</th>
<th bgcolor="aqua" valign="bottom" align="left">Choices</th>
<th bgcolor="aqua" valign="bottom" align="left">Notes</th>
</tr>
<tr>
<td valign="top"><a href="#CRTJVAPGM.CLSF"><b>CLSF</b></a></td>
<td valign="top">Class file or JAR file</td>
<td valign="top"><i>Path name</i></td>
<td valign="top">Required, Positional 1</td>
</tr>
<tr>
<td valign="top"><a href="#CRTJVAPGM.CLASSPATH"><b>CLASSPATH</b></a></td>
<td valign="top">Classpath</td>
<td valign="top"><i>Path name</i>, <b><u>*NONE</u></b>, *ENVVAR</td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#CRTJVAPGM.JDKVER"><b>JDKVER</b></a></td>
<td valign="top">Java developer kit version</td>
<td valign="top"><i>Character value</i>, <b><u>*NONE</u></b></td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#CRTJVAPGM.OPTIMIZE"><b>OPTIMIZE</b></a></td>
<td valign="top">Optimization</td>
<td valign="top"><b><u>10</u></b>, *INTERPRET, 20, 30, 40</td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#CRTJVAPGM.USRPRF"><b>USRPRF</b></a></td>
<td valign="top">User profile</td>
<td valign="top"><b><u>*USER</u></b>, *OWNER</td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#CRTJVAPGM.USEADPAUT"><b>USEADPAUT</b></a></td>
<td valign="top">Use adopted authority</td>
<td valign="top"><b><u>*NO</u></b>, *YES</td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#CRTJVAPGM.REPLACE"><b>REPLACE</b></a></td>
<td valign="top">Replace program</td>
<td valign="top"><b><u>*YES</u></b>, *NO</td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#CRTJVAPGM.ENBPFRCOL"><b>ENBPFRCOL</b></a></td>
<td valign="top">Enable performance collection</td>
<td valign="top"><b><u>*NONE</u></b>, *ENTRYEXIT, *FULL</td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#CRTJVAPGM.PRFDTA"><b>PRFDTA</b></a></td>
<td valign="top">Profiling data</td>
<td valign="top"><b><u>*NOCOL</u></b>, *COL</td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#CRTJVAPGM.SUBTREE"><b>SUBTREE</b></a></td>
<td valign="top">Directory subtree</td>
<td valign="top"><b><u>*NONE</u></b>, *ALL</td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#CRTJVAPGM.TGTRLS"><b>TGTRLS</b></a></td>
<td valign="top">Target release</td>
<td valign="top"><i>Character value</i>, <b><u>*CURRENT</u></b></td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#CRTJVAPGM.LICOPT"><b>LICOPT</b></a></td>
<td valign="top">Licensed Internal Code options</td>
<td valign="top"><i>Character value</i>, <b><u>*OPTIMIZE</u></b></td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#CRTJVAPGM.LICOPTFILE"><b>LICOPTFILE</b></a></td>
<td valign="top">LIC options file</td>
<td valign="top"><i>Path name</i>, <b><u>*NONE</u></b></td>
<td valign="top">Optional</td>
</tr>
</table>
<table width="100%">
<tr><td align="right"><a href="#CRTJVAPGM.Top_Of_Page">Top</a></td></tr>
</table>
</div>
<div> <a name="CRTJVAPGM.CLSF"></a>
<h3>Class file or JAR file (CLSF)</h3>
<p>Specifies the class file , JAR file, or ZIP file name from which to create the Java program. The file name may be qualified by one or more directory names.
</p>
<dl>
<dt><b><i>class-file-name</i></b></dt>
<dd>Specify the name of the class file or a pattern for identifying the class file or files to be used. A pattern can be specified in the last part of the name. An asterisk matches any number of characters and a question mark matches a single character. If the name is qualified or contains a pattern it must be enclosed in apostrophes. An example of a qualified class file name is '/directory1/directory2/myclassname.class'. An example of a pattern is '/directory1/directory2/myclass*.class'.
</dd>
<dt><b><i>JAR-file-name</i></b></dt>
<dd>Specify the name of the Java archive (JAR) file or pattern for identifying the JAR or ZIP file or files to be used. A file is assumed to be a JAR file if the file name ends with '.jar' or '.zip'. A pattern can be specified in the last part of the name. An asterisk matches any number of characters and a question mark matches a single character. If the name is qualified or contains a pattern it must be enclosed in apostrophes. An example of a qualified JAR file name is '/directory1/directory2/myappname.jar'. An example of a pattern is '/directory1/directory2/myapp*.zip'.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#CRTJVAPGM.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="CRTJVAPGM.CLASSPATH"></a>
<h3>Classpath (CLASSPATH)</h3>
<p>Specifies the path used to locate classes for inter-JAR binding. Directories are separated by colons.
</p>
<dl>
<dt><b><u>*NONE</u></b></dt>
<dd>No additional directories or JAR files are added to the class path for locating classes.
</dd>
<dt><b>*ENVVAR</b></dt>
<dd>The class path is determined by the environment variable CLASSPATH.
</dd>
<dt><b><i>class-path</i></b></dt>
<dd>Path used to locate classes. An example class path is '/directory1/directory2:/QIBM/ProdData/Java400'.
</dd>
</dl>
<p>Either CLASSPATH or JDKVER must be specified for inter-JAR binding to occur. CLASSPATH must be *NONE when CLSF is a class file.
</p>
</div>
<table width="100%">
<tr><td align="right"><a href="#CRTJVAPGM.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="CRTJVAPGM.JDKVER"></a>
<h3>Java developer kit version (JDKVER)</h3>
<p>Specifies the Java Development Kit (JDK) version to add to the class path for locating classes for inter-JAR binding.
</p>
<dl>
<dt><b><u>*NONE</u></b></dt>
<dd>No additional directories for this JDK version are added to the class path for locating classes.
</dd>
<dt><b><i>Java-Development-Kit version</i></b></dt>
<dd>The jar files and directories for this JDK version are added to the class path for locating classes. An example JDK version is '1.2.2'.
</dd>
</dl>
<p>Either CLASSPATH or JDKVER must be specified for inter-JAR binding to occur. JDKVER must be *NONE when CLSF is a class file.
</p>
</div>
<table width="100%">
<tr><td align="right"><a href="#CRTJVAPGM.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="CRTJVAPGM.OPTIMIZE"></a>
<h3>Optimization (OPTIMIZE)</h3>
<p>Specifies the optimization level of the Java program. For OPTIMIZE(*INTERPRET), the resulting Java program will be pre-verified and converted to an internal form. Then, it will be interpreted when it runs. For other optimization levels, the Java program contains server machine instruction sequences that are run when the Java program is invoked. These server machine instructions have been optimized based on the specified optimization level. The server directly runs the machine instructions when the program runs.
</p>
<p>OPTIMIZE(*INTERPRET) Java programs are smaller but run slower than Java programs created with higher optimization levels. As the optimization level is increased beyond 10, the Java program performance generally improves, but the time required to create the Java program increases and debugging is more difficult.
</p>
<dl>
<dt><b><u>10</u></b></dt>
<dd>The Java program contains a compiled version of the class byte codes but has only minimal additional compiler optimization. Variables can be displayed and modified while debugging.
</dd>
<dt><b>*INTERPRET</b></dt>
<dd>The Java program created does not contain machine specific instructions. The Java program is interpreted from the byte codes when it is started.. Variables can be displayed and modified while debugging.
</dd>
<dt><b>20</b></dt>
<dd>The Java program contains a compiled version of the class byte codes and has some additional compiler optimization. Variables can be displayed but not modified while debugging.
</dd>
<dt><b>30</b></dt>
<dd>The Java program contains a compiled version of the class byte codes and has more compiler optimization than optimization level 20. During a debug session, user variables cannot be changed, but can be displayed. The presented values may not be the current values of the variables.
</dd>
<dt><b>40</b></dt>
<dd>The Java program contains a compiled version of the class byte codes and has more compiler optimization than optimization level 30. All call and instruction tracing is disabled.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#CRTJVAPGM.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="CRTJVAPGM.USRPRF"></a>
<h3>User profile (USRPRF)</h3>
<p>Specifies whether the authority checking done while this program is running should include only the user who is running the program (*USER) or both the user who is running the program and the program owner (*OWNER). The profiles of the program user or both the program user and the program owner are used to control which objects can be used by the program, including the authority the program has for each object. Only the program owner or a user with QSECOFR authority can change the user profile attribute.
</p>
<dl>
<dt><b><u>*SAME</u></b></dt>
<dd>The user profile attribute does not change.
</dd>
<dt><b>*USER</b></dt>
<dd>The program runs under the user profile of the program's user.
</dd>
<dt><b>*OWNER</b></dt>
<dd>The user profiles of both the program's owner and the program's user are used when the program is processed. The collective sets of object authority in both user profiles are used to find and access objects during program processing. Authority from the owning user profile's group profile is not included in the authority for the running program.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#CRTJVAPGM.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="CRTJVAPGM.USEADPAUT"></a>
<h3>Use adopted authority (USEADPAUT)</h3>
<p> Specifies whether program adopted authority from previous programs in the call stack will be used as a source of authority when this program is running.
</p>
<dl>
<dt><b><u>*NO</u></b></dt>
<dd>Program adopted authority from previous call levels is not used when this program is running.
</dd>
<dt><b>*YES</b></dt>
<dd>Program adopted authority from previous call levels is used when this program is running. If an authorization list is specified for the QUSEADPAUT system value and the user is not authorized to that authorization list, *NO is used.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#CRTJVAPGM.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="CRTJVAPGM.REPLACE"></a>
<h3>Replace program (REPLACE)</h3>
<p>Specifies whether an existing Java program associated with this file is replaced with the new Java program being created.
</p>
<dl>
<dt><b><u>*YES</u></b></dt>
<dd>The existing Java program associated with this file is replaced by the new Java program created.
</dd>
<dt><b>*NO</b></dt>
<dd>An existing Java program associated with this file is replaced only if the class file was changed since the existing program was created; otherwise, creation of the new Java program is stopped and a message is displayed. If a pattern was used to indicate multiple creations, processing continues with the next file.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#CRTJVAPGM.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="CRTJVAPGM.ENBPFRCOL"></a>
<h3>Enable performance collection (ENBPFRCOL)</h3>
<p>Specifies whether collection of performance data is enabled.
</p>
<dl>
<dt><b><u>*NONE</u></b></dt>
<dd>The collection of performance data is not enabled. No performance data is to be collected.
</dd>
<dt><b>*ENTRYEXIT</b></dt>
<dd>Performance data is collected for procedure entry and exit.
</dd>
<dt><b>*FULL</b></dt>
<dd>Performance data is collected for procedure entry and exit. Performance data is also collected before and after calls to external procedures.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#CRTJVAPGM.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="CRTJVAPGM.PRFDTA"></a>
<h3>Profiling data (PRFDTA)</h3>
<p>Specifies the program profiling data attribute for the module. Program profiling is an advanced optimization technique to reorder procedures and code within the procedures based on statistical data (profiling data)
</p>
<dl>
<dt><b><u>*NOCOL</u></b></dt>
<dd>The Java program is not enabled to collect profiling data.
</dd>
<dt><b>*COL</b></dt>
<dd>This Java program is enabled to collect profiling data.
<p>
<b>Note: </b>*COL can be specified only when the optimization level of the Java program is 30 or greater and is not being changed.
</p>
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#CRTJVAPGM.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="CRTJVAPGM.SUBTREE"></a>
<h3>Directory subtree (SUBTREE)</h3>
<p>Specifies whether directory subtrees are processed when looking for files that match the CLSF keyword.
</p>
<dl>
<dt><b><u>*NONE</u></b></dt>
<dd>Only the files that match the object name pattern will be processed. No subtrees are processed. If the directory has subdirectories, neither the subdirectories nor the objects in the subdirectories are processed.
</dd>
<dt><b>*ALL</b></dt>
<dd>The entire subtree of the path specified in CLSF is processed to create java programs for files matching the name specified on CLSF parameter.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#CRTJVAPGM.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="CRTJVAPGM.TGTRLS"></a>
<h3>Target release (TGTRLS)</h3>
<p>Specifies the release of the operating system on which you intend to use the object being created. When specifying the target-release value, the format VxRxMx is used to specify the release, where Vx is the version, Rx is the release, and Mx is the modification level. For example, V4R2M0 is version 4, release 2, modification level 0.
</p>
<p>Valid values depend on the current version, release, and modification level, and they change with each new release.
</p>
<dl>
<dt><b><u>*CURRENT</u></b></dt>
<dd>The object is to be used on the release of the operating system currently running on your system. The object can also be used on a system with any subsequent release of the operating system installed.
</dd>
<dt><b><i>target-release</i></b></dt>
<dd>Specify the release in the format VxRxMx. The object can be used on a system with the specified release or with any subsequent release of the operating system installed.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#CRTJVAPGM.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="CRTJVAPGM.LICOPT"></a>
<h3>Licensed Internal Code options (LICOPT)</h3>
<p>Specifies one or more Licensed Internal Code compile-time options. This parameter allows individual compile-time options to be selected, and is intended for the advanced programmer who understands the potential benefits and drawbacks of each selected type of compiler option.
</p>
<dl>
<dt><b><u>*OPTIMIZE</u></b></dt>
<dd>Use the set of compile-time options which are implicitly associated with the optimization level specified on the OPTIMIZE parameter. If OPTIMIZE(*INTERPRET) is specified, no compile-time optimizations will be performed.
</dd>
<dt><b><i>'Licensed-Internal-Code-options-string'</i></b></dt>
<dd>The selected Licensed Internal Code compile-time options are used when creating the Java program object. Certain options may reduce your ability to debug the created Java program.
<p>
<b>Note: </b>Additional information about the LICOPT options can be found in the IBM Developer Kit for Java reference in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter.
</p>
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#CRTJVAPGM.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="CRTJVAPGM.LICOPTFILE"></a>
<h3>LIC options file (LICOPTFILE)</h3>
<p>Specifies a file name which lists one or more Licensed Internal Code compile-time options.
</p>
<dl>
<dt><b><u>*NONE</u></b></dt>
<dd>There is no file specified.
</dd>
<dt><b><i>'Licensed-Internal-Code-options-filename'</i></b></dt>
<dd>The file is used for specifiying which Licensed Internal Code compile-time options are used when creating the Java program object. Certain options may reduce your ability to debug the created Java program.
<p>
<b>Note: </b>Additional information about the LICOPT options can be found in the IBM Developer Kit for Java reference in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter.
</p>
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#CRTJVAPGM.Top_Of_Page">Top</a></td></tr>
</table>
<hr size="2" width="100%">
<div><h3><a name="CRTJVAPGM.COMMAND.EXAMPLES">Examples</a> </h3>
<p><b>Example 1: Create an Optimized Java Program</b>
</p>
<p>
<pre>
CRTJVAPGM CLSF('/projectA/myJavaclassname.class')
OPTIMIZE(10)
</pre>
</p>
<p>This command will create a Java program and associate it with the class file myJavaclassname. The Java program will contain compiled machine instruction sequences which will be run when the Java program is invoked via the RUNJVA (Run Java) or the JAVA CL command.
</p>
<p><b>Example 2: Create a Java Program Specifying a LICOPT File</b>
</p>
<p>
<pre>
CRTJVAPGM CLSF('/projectA/myJavaclassname.class')
LICOPTFILE('/projectA/mylicoptfile.txt')
</pre>
</p>
<p>This command will create a Java program and associate it with the class file myJavaclassname. The command will read the Licensed Internal Code options contained in the text file mylicoptfile.txt and prepend them to the default Licensed Internal Code Options used when generating compiled machine instruction sequences.
</p>
<p><b>Example 3: Create Numerous Java Programs</b>
</p>
<p>
<pre>
CRTJVAPGM CLSF('/projectA/*.class') SUBTREE(*ALL)
</pre>
</p>
<p>This command will create a Java program and associate it with any class file in the projectA directory and any class file in directories below projectA.
</p>
</div>
<table width="100%">
<tr><td align="right"><a href="#CRTJVAPGM.Top_Of_Page">Top</a></td></tr>
</table>
<hr size="2" width="100%">
<div><h3><a name="CRTJVAPGM.ERROR.MESSAGES">Error messages</a> </h3>
<p><b><u>*ESCAPE Messages</u></b>
</p>
<dl>
<dt><b>JVAB524</b></dt>
<dd>&amp;1 Java programs created, &amp;4 with errors. &amp;2 Java programs were current. &amp;3 Java programs not created
</dd>
<dt><b>JVAB532</b></dt>
<dd>Unable to create Java program for "&amp;1".
</dd>
<dt><b>JVAB535</b></dt>
<dd>Unmonitored exception received.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#CRTJVAPGM.Top_Of_Page">Top</a></td></tr>
</table>
</body>
</html>