Hi John,

They've managed to make Java version selection, and therefore info, pretty complicated on the AS/400. You might consider calling a Java program that gets the system property "java.version" and puts it in a CL readable location like a data area. That should always be the version Java is currently using.

See:

http://docs.oracle.com/javase/tutorial/essential/environment/sysprop.html

Alternatively, you might make the choice of which Java class to run directly in the Java program after determining the version as above. That would also have the benefit of running on any system. Obviously, system specific capabilities only run on the specific system. I have written programs that determine the current OS, like AS/400 or Windows, to determine how to do things.

HTH,


Joe Sam

Joe Sam Shirah - www.conceptgo.com (904) 302-6870
conceptGO - Consulting/Development/Outsourcing
Java Filter Forum: www.ibm.com/developerworks/java
Just the JDBC FAQs: www.jguru.com/faq/JDBC
Going International? www.jguru.com/faq/I18N
Que Java400? www.jguru.com/faq/Java400




-----Original Message----- From: John Allen
Sent: Wednesday, August 14, 2013 4:29 PM
To: 'Java Programming on and around the IBM i'
Subject: RE: How to retrieve current default Java version programatically

Thanks.
This works on V5R3 (Have not tested on V5R4)
On 6.1 JAVA *VERSION starts qshell and displays the version
on the QSHELL screen (nothing in the joblog)

Did this change in 6.1 (or V5R4) or is there something with
the RUNJVA *VERSION I can specify to make it work
like V5R3 (Use message instead of QSHELL to display the
version)


Thanks

John


-----Original Message-----
From: Dan Kimmel [mailto:dkimmel@xxxxxxxxxxxxxxx]
Sent: Wednesday, August 14, 2013 4:08 PM
To: Java Programming on and around the IBM i
Subject: RE: How to retrieve current default Java version
programatically

Follow RUNJVA *VERSION with RTVMSG.

Additional Message Information



Message ID . . . . . . : JVAB52C Severity . . . . .
. . : 00
Message type . . . . . : Completion

Date sent . . . . . . : 08/14/13 Time sent . . . .
. . : 14:51:39


Message . . . . : Version JVM V5R1M0 JDK 1.4.2.

Cause . . . . . : The Java version is Java Virtual
Machine (JVM) V5R1M0 and
Java Development Kit (JDK) 1.4.2.


Select Message Details to Display

Message ID . . . . . . . . . : JVAB52C
Message file . . . . . . . . : QJVAMSG
Library . . . . . . . . . : QJAVA
Message text . . . . . . . . : Version JVM &1 JDK &2.

Display Field Data



Message ID . . . . . . . . . : JVAB52C

Message file . . . . . . . . : QJVAMSG

Library . . . . . . . . . : QJAVA





Decimal Vary

Field Data Type Length Positions Length
Dump
&1 *CCHAR *VARY 4
*NO
&2 *CCHAR *VARY 4
*NO

-----Original Message-----
From: java400-l-bounces@xxxxxxxxxxxx [mailto:java400-l-
bounces@xxxxxxxxxxxx] On Behalf Of John Allen
Sent: Wednesday, August 14, 2013 2:49 PM
To: 'Java Programming on and around the IBM i'
Subject: How to retrieve current default Java version
programatically

Is there a way to programmatically (CL or RPG) to retrieve
the current
default version of JAVA that is set.

I need to conditionally execute CL code based on the
current default
version of JAVA (The Java Version that will run if I were
to execute
RUNJAVA)
I know I can retrieve the version(s) of JAVA that are
installed, but I
need the current default version.
The version that is displayed by running JAVA *VERSION

Example
If CurVerJava < "1.5"
Do A
Else
Do B
Enddo


Thanks

John


--
This is the Java Programming on and around the IBM i
(JAVA400-L) mailing list To post a message email:
JAVA400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change
list options,
visit: http://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request@xxxxxxxxxxxx Before posting,
please take a moment to review the archives at
http://archive.midrange.com/java400-l.



-----
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2013.0.2904 / Virus Database: 3209/6563 - Release
Date: 08/09/13

-----
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2013.0.2904 / Virus Database: 3211/6576 - Release
Date: 08/14/13


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-2022 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.