MATLAB: Do I get an undefined variable “com” or class “com.mathw​orks.jmi.C​lassLoader​Manager.ge​tClassLoad​erManager” when running the deployed application

hpiMATLAB Compiler

I have set up the LD_LIBRARY_PATH variable using the directories specified in the documentation, but in a different order.
I have an application that I can run from within MATLAB using the bang(!) operator. When I try running it from outside of MATLAB or on a deployed machine, I get the following error:
Opening log file: /export/home/vnmr1/java.log.7291
??? Undefined variable "com" or class "com.mathworks.jmi.ClassLoaderManager.getClassLoaderManager".
Error in ==> javaclasspath>local_javapath at 114
Error in ==> javaclasspath at 62
Error in ==> javaaddpath at 66
Could not initialize the dynamic Java classpath needed for toolboxes and
custom java classes. The Java calls may not work in the deployed mode. If
you are using certain MathWorks toolbox that uses jar files, you can
extract the CTF archive by either running the application once or using the
extractCTF utility and then copy the toolbox jar file from
<component>_mcr/java/jar/toolbox directory to the <mcrroot>/java/jar/toolbox
directory. For your custom Java class and jar files, you can copy these to
any directory on your target machine and add this directory and/or the jar
files with fully qualified path to the classpath.txt in your MCR installation.
#
# An unexpected error has been detected by HotSpot Virtual Machine:
#
# SIGSEGV (0xb) at pc=0xfd6aebc0, pid=7291, tid=2
#
# Java VM: Java HotSpot(TM) Client VM (1.5.0-b64 mixed mode, sharing)
# Problematic frame:

Best Answer

This bug has been fixed in Release 2007a (R2007a). For previous product releases, read below for any possible workarounds:
This error is due to the ordering of the Java library entries within the LD_LIBRARY_PATH on Solaris machines. Because order is significant in the LD_LIBRARY_PATH variable, the directories should be specified in the order shown in the documentation.
In particular, the following path:
$MCRROOT/sys/java/jre/sol2/jre1.5.0/lib/sparc/server
or
$MCRROOT/sys/java/jre/sol2/jre1.5.0/lib/sparc/client
should precede
$MCRROOT/sys/java/jre/sol2/jre1.5.0/lib/sparc/
in the LD_LIBRARY_PATH environment variable.
Specifying the libjvm.so in the sparc/client/ or sparc/server directory locates the sparc/native_threads/libhpi.so library correctly. Specifying the libjvm.so in sparc/ searches in the wrong location.