Question:
When I run my program with an older version of the Java runtime environment I get the following error:
java.lang.UnsupportedClassVersionError: ABCPROG has been compiled by a more recent version of the Java Runtime (class file version 61.0),What can I do to resolve this?
Answer:
You can use the -jo compiler command line option in order to specify options to be passed to the Java compiler such as:
"-source" and "-target".
For example, to compile for compatibility with Java 1.8, add the following to your compile command line
-jo="-source 1.8 -target 1.8"To compile a program named MYPROG.cbl:
iscc -jo="-source 1.8" MYPROG.cbl(you can omit "-target 1.8" since it is the default when specifying "-source 1.8")
javac --help -source
javap -verbose MYPROG | grep majoror run
javap -verbose MYPROGand the version numbers will be reported in the first 5 lines.
Article ID: 57
Created: August 31, 2009
Last Updated: October 3, 2022
Author: Support KB Author
Online URL: https://support.veryant.com/support/phpkb/article.php?id=57