Determine Java Version from RPG

pts.
Tags:
Application development
Development
Java
RPG ILE
RPGLE
I have multiple solutions dependent upon the version of java or the lack of java on an iSeries, all controlled from RPG. From RPG,how can I determine if java is installed on the machine and if installed, what version? Any ideas?

Answer Wiki

Thanks. We'll let you know when a new response is added.

To get started… no api’s: use the DSPSFWRSC command and direct output to an outfile, which you may access through normal RPG or CL-coding. The content of this file answers your needs. Sample command:
DSPSFWRSC OUTPUT(*OUTFILE) +
OUTFILE(MYLIB/MYFILE) +
OUTMBR(*FIRST *REPLACE)

==========================================================

In general, to find if a product is installed, call the <a href=”http://publib.boulder.ibm.com/infocenter/iseries/v5r4/topic/apis/qszrtvpr.htm”>Retrieve Product Information (QSZRTVPR) API</a> passing in the info for the product you want.

Here’s a very basic example that retrieves info for Java 1.4, which is 5722-JV1 option 6 on V5R4:<pre>
pgm

dcl &rcvvar *char 108 value( ‘ ‘ )
dcl &PRDI0100 *char 27 value( ’5722JV1*CUR 0006*CODE’ )

call QSZRTVPR ( +
&rcvvar +
x’0000006C’ +
‘PRDR0100′ +
&PRDI0100 +
x’0000000000000000′ +
)

dmpclpgm

return

endpgm</pre>
You might retrieve the i5/OS info first, to decide if 5722-JV1 is the correct product ID to look for. And you might choose to list load/option pairs to decide which ones are available.

Tom

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TomLiotta
    Do you want all available versions or just the newest/latest? Tom
    125,585 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following