Migrating applications to new Java versions
It is important to review differences between Java versions when migrating applications.
Applications must be modified if they use APIs that are removed in later versions of Java.
Available versions
- 6.3 IBM® Semeru Runtime® Certified Edition for z/OS®, Version 17 and Version 21
- 6.16.2 IBM Semeru Runtime Certified Edition for z/OS, Version 11, Version 17 and Version 21
- IBM 64-bit SDK for z/OS, Java™ Technology Edition, Version 8
For more information, see Java runtime environments.
Benefits of moving to a new Java version
- Gain advantage from new API.
- Stay up to date with security fixes.
- Remain current with performance improvements.
- Benefit from improved interoperability with distributed platforms.
Check your programs for deprecated APIs
- Migrating from earlier releases of IBM SDK, Java Technology Edition in the documentation for IBM Semeru Runtime Certified Edition for z/OS; and
- Migration to the latest version of Java made easy on IBM Developer.
Check your Java programs for compatibility issues between the supported IBM SDK for z/OS and previous versions. Code that was compiled with an older version of Java continues to run unless it uses APIs that are removed in the newer version of Java or CICS. If code does use APIs that are removed, make any changes necessary to enable your programs to run with the supported versions.
In addition to Java APIs, check your programs for deprecated or removed CICS JCICS APIs. For more information, see Upgrading the Java environment.
File encoding and UTF-8 as default charset
Java 21 Applies to Java 21.
In Java 21, the default character set for standard Java APIs is UTF-8, except for the console input and output encoding. Earlier versions of Java use an EBCDIC default character set. Processing of EBCDIC-based data is common in CICS Java applications so this change is significant.
Applications that were designed and tested for use with earlier versions of Java are likely to behave differently with Java 21. Check your Java programs to make sure that they do not assume that the default encoding is EBCDIC.
Applications deployed to Liberty are not affected since Liberty is only supported when it is running under a JVM with the UTF-8 or ISO-8859-1 character encoding in CICS.
JCICS APIs that use String objects automatically handle code page conversions. Update Java applications to use String-based JCICS methods rather than older JCICS methods that interact with byte[] data.
- Calls to
String.getBytes(). InputStreamReader,FileReader,OutputStreamWriter,FileWriter, andPrintStreamAPIs of thejava.iopackage.FormatterandScannerAPIs of thejava.utilpackage.URLEncoder, andURLDecoderAPIs of thejava.netpackage.
Setting -Dfile.encoding=COMPAT in the JVM profile reverts to Java 17 behavior, where native encoding is determined based on locale. This
option should be used with caution because Java software
libraries are likely to assume UTF-8 encoding everywhere in the future.
For more information, file.encoding property values, and auto-conversion of
input files, see File encoding and UTF-8 as default charset in the IBM Semeru Runtime Certified Edition for z/OS documentation.