Beginning in SAS Enterprise Miner 15.3, an underlying change occurred that affects the generation of the Java Score Code from the Score node. In SAS 9.4M8 (TS1M8), which is the underlying SAS version for SAS Enterprise Miner 15.3, the private Java Runtime Environment (JRE) that is shipped is Java 11. In previous versions, the SAS private JRE is Java 8. This update affects the Java Score Code generation because the required Java Runtime JAR file (rt.jar) does not exist anymore.
Let's assume your project has a standard flow within a diagram as seen below:
If the JAR file is not updated, the results do not return two of the four expected Java score files even though the node indicates that it ran successfully:
In the log file, these error messages occur:
TScore NOTE: Start Java code generation ........
PATHJSCORECODE.sas 1: Could not load class java/lang/Object.
PATHJSCORECODE.sas 1: Could not load class java/lang/Object.
PATHJSCORECODE.sas 1: Could not load superclass java/lang/Object.
WARNING: Beginning in SAS Enterprise Miner 15.3, the Java score code generation utility requires that a jar file be manually installed. Please see documentation for instructions.
ERROR: TScore Java code generation failed.
*------------------------------------------------------------*
* Warning: A problem was encountered while generating the Java score code.
*------------------------------------------------------------*
To be able to generate Java Score code, you must create a new Java JAR file and modify a SAS Runtime environment variable (DTJ_CLASSPATH), which is defined in the SAS configuration file.
Note: Before completing these steps to address the problem, back up the SAS configuration file (sasv9.cfg).
Instructions for Microsoft Windows (x64)
To create the Java JAR file javabase.jar on a Windows x64 machine, complete these steps:
- Download the JDK 11 package from jdk.java.net.
- Unzip the file to your C: drive. For example, the unzipped file can be C:\jdk-11.
- Open a DOS command prompt and set the JAVA_HOME environment variable with this command: set JAVA_HOME=C:\jdk-11
- Update the path with this command: path=%JAVA_HOME%\bin;%path%
- Create the temporary directory, C:\tempjar, and change directory to C:\tempjar.
- Extract the Java base classes with this command: jmod.exe extract %JAVA_HOME%\jmods\java.base.jmod --dir C:\tempjar
- Change directory to extracted classes with this command: cd C:\tempjar\classes
- Create the Java JAR file javabase.jar with this command: jar.exe -cf javabase.jar *
To add the Java javabase.jar file to your SAS directory and update the SAS configuration file on a Windows system, complete these steps:
- Copy the Java JAR file javabase.jar from C:\tempjar\classes to this directory: C:\Program Files\SASHome\SASFoundation\9.4\dmine\sasmisc
- Locate the SAS configuration file: C:\Program Files\SASHome\SASFoundation\9.4\nls\en\sasv9.cfg
- In the sasv9.cfg file, find the variable DTJ_CLASSPATH and append the javabase.jar file to it. For example, the modified line will be as follows:
-SET DTJ_CLASSPATH "C:\Program Files\SASHome\SASFoundation\9.4\dmine\sasmisc\dtj.jar;C:\Program Files\SASHome\SASFoundation\9.4\dmine\sasmisc\javabase.jar"
Instructions for Linux (x64)
To create the Java javabase.jar file on a Linux x64 machine, complete these steps:
- Download the JDK 11 package from jdk.java.net.
- In an Xterm, create the temporary directory /tmp/jdk with this command: mkdir /tmp/jdk
- Move the downloaded openjdk-11+28_linux-x64_bin.tar.gz file to the /tmp/jdk directory.
- Change directory to /tmp/jdk with this command: cd /tmp/jdk
- Uncompress the file with this command: gunzip openjdk-11+28_linux-x64_bin.tar.gz
- Extract the JDK files with this command: tar -xf openjdk-11+28_linux-x64_bin.tar
- Set the JDK path with this command: export PATH=/tmp/jdk/jdk-11/bin:$PATH
- Extract the Java base classes with this command: jmod extract /tmp/jdk/jdk-11/jmods/java.base.jmod --dir /tmp/jdk
- Change directory to /tmp/jdk/classes with this command: cd /tmp/jdk/classes
- Create the Java javabase.jar file with this command: jar -cf javabase.jar *
To add the Java javabase.jar file to the SAS directory and update the SAS configuration file on a Linux system, complete these steps:
- Find the SASHome location and set the SASHome environment variable: export SASHome=/usr/local/SAS
- Copy the Java javabase.jar file to the $SASHome/SASFoundation/9.4/misc/dmine directory.
- Edit the SAS $SASHome/SASFoundation/9.4/sasv9.cfg configuration file by appending $SASHome/SASFoundation/9.4/misc/dmine/javabase.jar file to the variable DTJ_CLASSPATH. For example, the modified line that contains DTJ_CLASSPATH will be as follows: -SET DTJ_CLASSPATH "/usr/local/SAS/SASFoundation/9.4/misc/dmine/dtj.jar:/usr/local/SAS/SASFoundation/9.4/misc/dmine/javabase.jar"
Restart SAS Enterprise Miner and rerun the flow. If you encounter any issues, contact SAS Technical Support.