Thank you Scott. Did not think of QSH. Actually outlook capitalized
the J in java for me. ( love how it thinks it's smarter than I )
Now I get the following error message:
java -cp /usr/bin/bb/java/bbas400.jar:/usr/bb/java/jt400.jar
com.shenmfg.AS400BBAgent /usr/bin/bb/java/server.properties &
[1] 193
$ java.lang.NoClassDefFoundError: com/ibm/as400/access/AS400JDBCDriver
at java.lang.Throwable.<init>(Throwable.java:195)
at java.lang.Error.<init>(Error.java:49)
at java.lang.LinkageError.<init>(LinkageError.java:36)
at
java.lang.NoClassDefFoundError.<init>(NoClassDefFoundError.java:40)
at com.shenmfg.AS400BBAgent.<init>(AS400BBAgent.java:49)
at com.shenmfg.AS400BBAgent.main(AS400BBAgent.java:99)
Chris Bipes
Director of Information Services
CrossCheck, Inc.
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Scott Klement
Chris Bipes wrote:
The instructions say to put this in to a CL script:
#!/bin/sh
PATH="$PATH:/usr/bin/jre1.2.2/bin" (but I do not have any jreX.X.X
directory.)
Java -cp /usr/bin/bb/java/bbas400.jar:/usr/bin/bb/java/jt400.jar
com.shenmfg.AS400BBAgent /usr/bin/bb/java/server.properties &
A CL script?! This appears to be a Bourne shell script for a Unix
system! but, even in that environment,it wouldn't work, because you've
capitalized the J in Java, and Unix is case-sensitive...
But, anyway... setting PATH is unnecessary. In Qshell, the 'java'
command is in your PATH by default, and in CL you use *LIBL, not PATH.
The other part. In QShell it would be just like it is in Unix:
java -cp /usr/bin/bb/java/bbas400.jar:/usr/bin/bb/java/jt400.jar
com.shenmfg.AS400BBAgent /usr/bin/bb/java/server.properties &
You can run that from CL with the STRQSH command...
Alternately, you can use the JAVA CL command (Though, you may have to
run CRTJVAPGM first)
This is a one-time only command (if you even need it):
CRTJVAPGM CLASS('/usr/bin/bb/java/bbas400.jar') +
CLASSPATH('/usr/bin/bb/java/jt400.jar')
Then the part you'd put in your "CL script" would be this:
JAVA CLASS('com.shenmfg.AS400BBAgent') +
PARM('/usr/bin/bb/java/server.properties') +
CLASSPATH('/usr/bin/bb/java/bbas400.jar:/usr/bin/bb/java/jt400.jar')
Note that the -cp switch on the Unix (or QShell) java command is short
for 'classpath', so the data that follows it belongs in the CLASSPATH
parameter to the JAVA command (you put it in the CLASS parameter). The
next parameter to the Unix/QShell java command is the name of the Java
class you want to run (which goes in the CLASS parameter of the JAVA CL
command). Everything after that is a parameter to pass to the JAVA
class.... in your case there's only one parameter, which is
/usr/bin/bb/java/server.properties. The & at the end of the Unix
command line means "run in the background"... the closest equivalent in
CL would be the SBMJOB command.
So if you want the SBMJOB command (though, I suspect you'll actually run
your entire CL program in batch instead) would look like this:
SBMJOB CMD(JAVA CLASS('com.shenmfg.AS400BBAgent') +
PARM('/usr/bin/bb/java/server.properties') +
CLASSPATH('/usr/bin/bb/java/bbas400.jar:/usr/bin/bb/java/jt400.jar'))
Sorry if that CLASSPATH line gets misformatted... but everything from
the word CLASSPATH to the end of the command is intended to be on a
single line with no spaces in it.
As an Amazon Associate we earn from qualifying purchases.