As the first step in the decommissioning of the site has been converted to read-only mode.

Here are some tips for How to share your SAS knowledge with your professional network.

Java JRE 1.5

From sasCommunity
Jump to: navigation, search

This document describes steps necessary to (re)install Java Runtime Environment (JRE) 1.5 for SAS v9.2.


Problem Statement


MyCompany's security upgrade of 2008-July-30 removed folder:

C:\Program Files\Java\jre1.5.0_12

and replaced it with:

C:\Program Files\Java\jre1.6.0_06


SAS v9.2 primary configuration file

C:\Program Files\SAS\SASFoundation\9.2\nls\en\SASv9.cfg

contains JREoptions which point to JRE-1.5:

-JREOPTIONS=(-Dsas.jre.libjvm=C:\PROGRA~1\Java\JRE15~1.0_1\bin\client\jvm.dll ...

note: the above line has been truncated at the first space note: line length = 593 note use of short 8.3 folder names

the above


refers to:

C:\Program Files\Java\jre1.5.0_12

Solution: reinstall JRE-1.5 in different folder

Note: this method replicates the placement of the JRE folder in SAS v9.1.3 under !SASroot\Shared-Files.

Make Directory

  • if not exist Java folder:
  • C:\Program Files\SAS\Shared Files\Java
  • then create

Download JRE 1.5 from Sun MicroSystems

Download links 2008-Dec-16

  • click on previous releases
  • Click on JDK 5.0 Update 17 – download
  • Click on windows offline installation
    • Jdk-1_5_17-windows-i586-p.exe
  • Save
  • It will download a file 1229445024161-integrated.jnlp
  • Run this file
  • Click on jdk-1_5_0_17-windows-i586-p.exe
  • Start the download
  • This is the file you need to run Java 5
  • I have found that
    • uninstalling older versions of SAS,
    • deleting the SAS directory and then
    • giving full control to the customer of c:\program files\sas after the install seem to help.

previous urls

Copy (or move) folder jre1.5.0_12

from folder

C:\Program Files\Java\jre1.5.0_12


C:\Program Files\SAS\Shared Files\Java\jre1.5.0_12

Fix SASv9.cfg

  • Open folder SAS v9.2 !SASroot:
    • C:\Program Files\SAS\SASFoundation\9.2
  • Find file SASv9.cfg
  • Copy file SASv9.cfg to SASv9-old.cfg
  • Copy file SASv9-JRE-1-5.cfg to !SASroot
-CONFIG "C:\Program Files\SAS\SASFoundation\9.2\nls\en\SASV9.CFG"

/* name: SASv9-JRE-1-5.cfg for SAS 9.2
         fix to use JRE 1.5 in SAS\Shared\Java
         RJF2 2008-Oct-02
****************************************** */
-Djava.class.path=C:\PROGRA~1\SAS\SASVER~1\9.2\eclipse\plugins\SASLAU~1.000\SASLAU~1.JAR!SASROOT\core\sasmisc\sas.login.config!SASROOT\picklist )

Note the above arguments to option JREOPTIONS are one long line in the primary configuration file !SASroot\nls\en\SASv9.cfg. Line breaks at each JREoption have been added and this is acceptable.

Note also that the SAS config file appears to tolerate full path names, not just 8.3 format names so the following will also work in the above fix:

-Dsas.jre.libjvm=C:\Program Files\SAS\Shared Files\Java\jre1.5.0_12\bin\server\jvm.dll

  • Rename SASv9-JRE-1-5.cfg to SASv9.cfg

Solution 2: create or use Environment Variable

see knowledge base

Examine DOS environment variables with the 'set' command.

This batch program shows all environment variables.

rem   dir-set-all.bat
set > dir-set-all.txt

Get a list of the available Java JRE folder names in 8.3 filename style.

rem dir-java.bat
rem show JRE folder names in 8.3 filename conventions
rem 8.3 filenames contain tilde(~)
dir "C:\Program Files\Java\*.*" /X >dir-java.txt

This is dir-java.txt.

Directory of C:\Program Files\Java

09/05/2008  09:51 AM    <DIR>                       .
09/05/2008  09:51 AM    <DIR>                       ..
09/05/2008  09:51 AM    <DIR>          JRE15~1.0_1  jre1.5.0_12
07/24/2008  12:22 AM    <DIR>          JRE16~3.0_0  jre1.6.0_03
07/24/2008  12:31 AM    <DIR>          JRE16~1.0_0  jre1.6.0_06

Allocate an environment variable using 8.3 filename conventions.

rem set-SAS-JRE-root.bat
rem c:\Program Files\Java\<JRE current version>
rem set SASJreRoot C:\PROGRA~1\Java\JRE15~1.0_1
rem set SASJreRoot C:\PROGRA~1\Java\JRE16~3.0_0
set SASJreRoot C:\PROGRA~1\Java\JRE16~1.0_0

Make a configuration file for current version of JRE.

To test see

/* name: SASv9-JRE-current-version.cfg */
/* check Win environment variable SASJreRoot using autoexecTest */
/* or use this allocation statememt to replace: /* ***
-SET SASJreRoot 'C:\PROGRA~1\Java\JRE16~1.0_0'  
/* end comment */ 

-Djava.class.path=C:\PROGRA~1\SAS\SASVER~1\9.2\eclipse\plugins\SASLAU~1.000\SASLAU~1.JAR!SASROOT\core\sasmisc\sas.login.config!SASROOT\picklist )

Call your JRE-current-version configuration file

/* name: SASv9.cfg */
-CONFIG "C:\Program Files\SAS\SASFoundation\9.2\nls\en\SASV9.CFG"
-config  'SASv9-JRE-current-version.cfg'


  • easy to build
  • easy to update
  • impossible to debug

RJF2 reporting from WUSS 2008-Nov-06

Note: SAS Tech Support is polishing a Tech Note on this fix.


  • Start SAS
  • Submit test program
    • download program from:

;/* name:
output: MatrixPlot.png
%put JREoptions: %sysfunc(getoption(JREOPTIONS));
PROC JavaInfo;

*------------------- Data on Iris Setosa --------------------*
| The data set contains 50 iris specimens from the species   |
| Iris Setosa with the following four measurements:          |
| SepalLength (sepal length)                                 |
| SepalWidth  (sepal width)                                  |
| PetalLength (petal length)                                 |
| PetalWidth  (petal width)                                  |
| Certain values were changed to missing for the analysis.   |
  • Review and confirm output:
    • test-Java.log
    • test-Java.lst
    • sashtml.htm
    • MatrixPlot.png
  • Close SAS

See also: SAS-L thread since Aug 2008:

  • Subject: v9.2 ERROR: Unable to load the Java Virtual Machine

--macro maven == the radical programmer 15:16, 17 October 2008 (EDT)

About the Author

  • Ronald J. Fehd
  • SAS license manager for ~2,000 users
  • SAS site representative
  • Centers for Disease Control
  • Atlanta, GA, USA

2010-April-12 see Java_JRE_changing