# SAS on 64b Ubuntu Linux

*This was contributed by a colleague from <span class="caps">UCI</span>, Harry Mangalam.*

Having spent 3 days debugging this, I thought I might make it easier   
for others who might run into it.

<span class="caps">SAS</span> 9.2 uses Java for at least some of its plotting routines   
(minimally the ‘ods graphics’).

The 64b version of <span class="caps">SAS</span> still uses the 32b version of Java and   
officially only supports <span class="caps">SUSE</span> and <span class="caps">RHEL</span> as a platform. For a variety   
of reasons, I run it on Ubuntu Intrepid, which meant that I got a   
flurry of "we do not support that platform’ replies from <span class="caps">SAS</span>   
technical support when I tried to figure out why it was failing   
with “<span class="caps">ERROR</span>: Cannot load Java Runtime Engine”

The short version is that in order to support the 32b version of Java,   
the 32b compatibility libs are required. You can install them on a   
Ubuntu platform with:

sudo apt-get install apt-get install ia32-libs ia32-sun-java5-bin\\  
sun-java5-jre libc6-i386 lib32gcc1 lib32z1 lib32stdc++6 lib32asound2\\  
lib32ncurses5

(if you’re going to use a direct-from-Sun <span class="caps">JRE</span>, omit the packages   
with ‘java’ in the names.).

I installed Sun’s latest 1.5 <span class="caps">JRE</span> (jre1.5.0\_21) in the same <span class="caps">SAS</span> root as   
their supplied <span class="caps">JRE</span> (jre1.5.0\_12). It seemed to work with SAS’s <span class="caps">JRE</span>,   
but it threw a few “Locking assertion failure” errors. Using Sun’s   
<span class="caps">JRE</span>, it ran without errors.

It also needs the environment vars set to tell <span class="caps">SAS</span> where to find   
things:

```
# convenience shortcutexport SASPATH=/where/you/rooted/SAS-x86_64/9.2# following is required to allow 32bit java to find its libs; may vary# with your installationexport LD_LIBRARY_PATH=${SASPATH}/jre1.5.0_21/lib/i386:\${SASPATH}/jre1.5.0_21/lib/i386/server:${LD_LIBRARY_PATH}# Need to set the CLASSPATH to the JRE root so when SAS calls java,the right one is executed.export JAVAHOME=${SASPATH}/jre1.5.0_21/
```

<span class="caps">SAS</span> tech support spent 3 days insisting that it was the wrong Java   
sub-version number that was the problem.

—   
Harry Mangalam – Research Computing, <span class="caps">NACS</span>, UC Irvine