|
From a CL program you can use RUNJVA (same as JAVA command), or you can run
QSH and pass the entire command, along with any parms, as a single string.
Examples:
RUNJVA CLASS(com.shawn.HelloWorld)
PARM(parm1 parm2)
CLASSPATH('/qibm/userdata/java400/myjar.jar')
or
JAVA CLASS(com.shawn.HelloWorld)
PARM(parm1 parm2)
CLASSPATH('/qibm/userdata/java400/myjar.jar')
(PARM defaults to *NONE, CLASSPATH defaults to *ENVVAR)
I sometimes prefer to simply call QSH. The CMD parm is entered exactly the
way you would enter it interactively within the qshell interpreter:
PGM
DCL &JAVA *CHAR 256
DCL &PARM1 *CHAR 10
CHGVAR &PARM1 'anyvalue'
CHGVAR VAR(&JAVA) VALUE('java -classpath +
/QIBM/UserData/Java400/myjar.jar +
com.shawn.HelloWorld' *BCAT &PARM1)
QSH CMD(&JAVA)
ENDPGM
Shawn
----- Original Message -----
From: <CYBRT1@aol.com>
To: <JAVA400-L@midrange.com>
Sent: Tuesday, March 06, 2001 12:40 PM
Subject: RE: RUNJVA command
> I run the java command inside Q-Shell, and call a java program on the IFS
and pass it arguments.(works fine). I wrote a cl program to call the java
program with RUNJVA and pass it PARMS. The java program never see's the
parms as arguments and crashes. Is there a work around so I can pass
arguments to my java program from CL RUNJVA.
>
> TIA,
> Tom
> +---
> | This is the JAVA/400 Mailing List!
> | To submit a new message, send your mail to JAVA400-L@midrange.com.
> | To subscribe to this list send email to JAVA400-L-SUB@midrange.com.
> | To unsubscribe from this list send email to
JAVA400-L-UNSUB@midrange.com.
> | Questions should be directed to the list owner: joe@zappie.net
> +---
+---
| This is the JAVA/400 Mailing List!
| To submit a new message, send your mail to JAVA400-L@midrange.com.
| To subscribe to this list send email to JAVA400-L-SUB@midrange.com.
| To unsubscribe from this list send email to JAVA400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner: joe@zappie.net
+---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.