× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi Doug,

I’m not a Java-on-i specialist, but

I ran this command on IBM i 7.3:
SBMJOB CMD('RUNJVA CLASS(garf.jar) PARM(barf)') +

If I read the docs correctly, there might be an error in the JAR manifest. This is from Info Center:

A jar file name may be specified only when running JDK 1.2 or higher. The start up class must be indicated by the Main-Class in the manifest header.


If you have built the JAR file yourself - you will need a manifest file, which tells the JVM which class in the JAR is the “Main Class” that should be run on startup.

I would still recommend to “rewrite” the Java class in RPG/SQL to have in-depth error checking on each step of the way - but that’s just my humble opinion.

Do you have the Java source of the JAR?

Regards,
Daniel

Von meinem iPhone gesendet

Am 24.02.2022 um 01:59 schrieb Mark Waterbury <mark.s.waterbury@xxxxxxxxxxxxx>:

 Scott,
I ran this command on IBM i 7.3:
SBMJOB CMD('RUNJVA CLASS(garf.jar) PARM(barf)') + JOBD(QGPL/QBATCHLOG) JOBQ(QGPL/QBATCH) + JOB(JAVABOMB)
where that class "garf.jar" does not exist ... (on purpose).
The job ended "normally" but if I look at the job log, I see this:
Message . . . . : -RUNJVA CLASS(garf.jar) PARM(barf) JVA0122 Escape 00 02/22/22 13:33:36.354771 QJVAUTLJVM QSYS *STMT QCMD QSYS 01C8From module . . . . . . . . : QJVAUTLJVM
From procedure . . . . . . : JvaSendMsg Statement . . . . . . . . . : 10 Message . . . . : Java program completed with exit code 1
Yet the job ended "normally."
Seems something is very wrong here?
Perhaps a simple CL "wrapper" that can do a MONMSG for JVA0122 and then throw a CPF9898 *ESCAPE message, to cause the job to end abnormally?
But why should that be necessary?
Hope that helps?
Mark S. Waterbury



On Wednesday, February 23, 2022, 07:44:33 PM EST, Scott Klement <rpg400-l@xxxxxxxxxxxxxxxx> wrote:

Hi Doug,

I don't know why RUNJVA wouldn't work? Check the CLASSPATH parameter
of the RUNJVA command and see if someone changed it to something other
than *ENVVAR? Also, you might verify that none of the needed envvars
(JAVA_HOME, CLASSPATH, etc) are being set only at the QShell level.

If they are set properly for the CL command line, it should work fine.

On 2/23/2022 12:14 PM, DEnglander--- via RPG400-L wrote:

I was trying to create a "Hello World" program to test parameter passing.
I can compile it with javac [in STRQSH] but when I use the RUNJVA CLASS()
command to execute it, I get a No Class Def Found Error. I checked the
CLASSPATH and one of the directories is pointing to the directory on the
IFS where the compiled class resides. I am not sure why RUNJVA cannot find
it. When I run the program in QSH [Java Hello] it works as I expect.

--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate link: https://amazon.midrange.com

--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate link: https://amazon.midrange.com

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 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.