Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

ODS graphics error

ERROR: Unable to load the Java Virtual Machine
Today I received this error while attempting to execute ODS graphics.  I was using SAS 9.2 on a windows XP platform.  In my prior life with another agency this problem has occurred when I upgraded from 9.1 to 9.2, so this must be a common issue.  Speaking with the local IT help desk and a SAS associate proved useless, yet the problem was solved.

The issue is an incorrect pathway present for your Java Virtual Machine.  You will need admin rights to fix this error, but once you access the files, it is quite easy.

1) Open the folder: C:\Program Files\SAS\SASFoundation\9.2\nls\en
  a) in this folder you will find a file called SASV9.CFG.
  b) make a copy of this folder called something else, i.e. SASv9_backup, just in case.

2) Open the program file containing your java files: C:\Program Files\Java

3) Open the file SASV9.CFG
   a) Scroll down until you hit the line that says:
        -JREOPTIONS=(-Dsas.jre.libjvm=C:\PROGRA~1\Java\JRE15~1.0_1\bin\client\jvm.dll
   b) This is the path SAS is taking to find your version of Java Virtual Machine.
   c) Return to the JAVA folder and check if that pathway exists, it probably won't.
   d) If you have the folder "JRE1.5.0_12" in the java folder then make a simple change to the pathway
   --JREOPTIONS=(-Dsas.jre.libjvm=C:\PROGRA~1\Java\jre15~1.0_1\bin\server\jvm.dll

 4) This is where I got hung up!
   a) Open SAS through the ORIGINAL pathway, not your normal shortcut.  The normal pathway is:
       C:\Program Files\SAS\SASFoundation\9.2\SAS.exe

5) Check to see if the fix worked by running:

%put JREoptions: %sysfunc(getoption(JREOPTIONS));
PROC JavaInfo;

If it runs the procedure with no errors, ODS graphics is ready to execute.


FIX 2.

For the second fix we will adjust the JREOPTIONS in the file SAS utilizes prior to going to the other SASv9.cfg we attempted to change.

1) Open C:\Program Files\SAS\SASFoundation\9.2

2) Locate SASV9.CFG, and make a back up

3) Open this file and under the first command line that states:

-CONFIG "C:\Program Files\SAS\SASFoundation\9.2\nls\en\SASV9.CFG"

Add a second command line:

-JREOPTIONS=(-Dsas.jre.libjvm=C:\PROGRA~1\Java\JRE6\bin\client\jvm.dll -Djava.security.policy=!SASROOT\core\sasmisc\sas.policy -Dsas.ext.config=!SASROOT\core\sasmisc\sas.java.ext.config -Dsas.app.class.path=C:\PROGRA~1\SAS\SASVER~1\9.2\eclipse\plugins\tkjava.jar -DPFS_TEMPLATE=!SASROOT\core\sasmisc\qrpfstpt.xml -Djava.class.path=C:\PROGRA~1\SAS\SASVER~1\9.2\eclipse\plugins\SASLAU~1.JAR -Djava.system.class.loader=com.sas.app.AppClassLoader -Xmx128m -Xms128m -Djava.security.auth.login.config=!SASROOT\core\sasmisc\sas.login.config -Dtkj.app.launch.config=!SASROOT\picklist)

NOTE!  This whole code needs to be in one line.

This fix will work if in the JAVA folder you have the folder "JRE6". 

Run the check on SAS:

%put JREoptions: %sysfunc(getoption(JREOPTIONS));
PROC JavaInfo;

If this PROC runs without an error, ODS graphics is fixed.

 Why this works.

You will notice that the pathway SAS originally uses to identify Java Virtual Machine (Java\JRE15~1.0_1\bin\client\jvm.dll) doesn't exist.  SAS needs to find the program "jvm.dll" and so we must force SAS to find that program.  By fixing the pathway we allow SAS to locate the necessary program to run ODS Graphics, thus solving the problem.

This was a major pain today and just wish to share the fix.



This post first appeared on SAS Beginner's Guide-Tips, Help And Statistics, please read the originial post: here

Share the post

ODS graphics error

×

Subscribe to Sas Beginner's Guide-tips, Help And Statistics

Get updates delivered right to your inbox!

Thank you for your subscription

×