This SAS KB article provides information about Java versions for SAS software running on z/OS.
SAS® 9.4M9 (TS1M9) running on z/OS uses a Java Runtime Environment that is based on Java 21.
SAS® 9.4M6 (TS1M6) - SAS® 9.4M8 (TS1M8) running on z/OS require Java 8 Service Refresh 8 (SR8) (31-bit), or a later Service Refresh for Java 8 (31-bit), which is required by 31-bit SAS 9.4 Foundation.
SAS® 9.4M0 (TS1M0) - SAS® 9.4M5 (TS1M5) running on z/OS use a Java Runtime Environment that is based on Java 7.
We recommend that you use the following Java releases and SR levels, because these levels incorporate the fix for CMVC IV54864, which is needed to invoke Java from SAS:
If you have an existing installation and need to use any of these Java SR levels, follow the directions documented in SAS Note 51008, "Java versions 1.6.0.1 SR6, 1.6.0.0 SR14, 1.7.0.0 SR5, and 1.7.1 initial release and later on z/OS systems might cause errors in SAS® programming."