01.01.2013 Views

CICS Transaction Gateway V5 The WebSphere ... - IBM Redbooks

CICS Transaction Gateway V5 The WebSphere ... - IBM Redbooks

CICS Transaction Gateway V5 The WebSphere ... - IBM Redbooks

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Compiling and using EciB1<br />

In the above test we used the compiled version of EciB1 inside the <strong>CICS</strong> TG<br />

samples JAR. In some cases we needed to alter EciB1 and run the modified<br />

version. To compile the EciB1 source file EciB1.java stored in the samples<br />

directory and then run it, we followed these steps from a Windows command<br />

prompt:<br />

1. We set the CLASSPATH to include the current directory and the <strong>CICS</strong> TG<br />

Java class library:<br />

set CLASSPATH=.;C:\Program Files\<strong>IBM</strong>\<strong>IBM</strong> <strong>CICS</strong> <strong>Transaction</strong><br />

<strong>Gateway</strong>\classes\ctgclient.jar<br />

2. We changed directory into the java subdirectory in the <strong>CICS</strong> TG samples<br />

directory:<br />

cd c:\Program Files\<strong>IBM</strong>\<strong>IBM</strong> <strong>CICS</strong> <strong>Transaction</strong> <strong>Gateway</strong>\samples\java<br />

3. We compiled the source file EciB1.java in the samples directory, which was<br />

stored under a directory hierarchy reflecting its Java package. We used the<br />

following command:<br />

javac com\ibm\ctg\samples\eci\EciB1.java<br />

4. We ran the copy of EciB1 we had just compiled in the samples directory:<br />

java com.ibm.ctg.samples.eci.EciB1 tcp://vmlinux1.itso.ibm.com<br />

<strong>The</strong> output of the session can be seen in Example 9-18.<br />

Example 9-18 Command session for compiling and running EciB1<br />

C:\>set CLASSPATH=.;c:\Program Files\<strong>IBM</strong>\<strong>IBM</strong> <strong>CICS</strong> <strong>Transaction</strong><br />

<strong>Gateway</strong>\classes\ctgclient.jar<br />

C:\>cd c:\Program Files\<strong>IBM</strong>\<strong>IBM</strong> <strong>CICS</strong> <strong>Transaction</strong> <strong>Gateway</strong>\samples\java<br />

C:\ctg\samples\java>javac com\ibm\ctg\samples\eci\EciB1.java<br />

C:\ctg\samples\java>java com.ibm.ctg.samples.eci.EciB1<br />

tcp://vmlinux1.itso.ibm.com<br />

Note: We set the CLASSPATH to include the current directory (the .<br />

character) because, when we executed the command to run EciB1, the Java<br />

interpreter looked for the file com\ibm\ctg\samples\eci\EciB1.class relative to<br />

any directories in the classpath. Because the current directory was c:\Program<br />

Files\<strong>IBM</strong>\<strong>IBM</strong> <strong>CICS</strong> <strong>Transaction</strong> <strong>Gateway</strong>\samples\java when we ran the<br />

command, the Java interpreter was able to find this file and successfully<br />

execute our modified version of EciB1.<br />

Chapter 9. TCP connections to the <strong>Gateway</strong> daemon on Linux 229

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!