Oracle JAVA Broken

From Olden Timey Wiki

Oracle 9i for Linux ships a broken JRE linked in the year before Christ.

$ /opt/oracle/product/jre/1.3.1/bin/java     ..
Error occurred during initialization of VM
Unable to load native library: /opt/oracle/product/jre/1.3.1/lib/i386/libjava.so:  
symbol __libc_wait, version GLIBC_2.0 not defined in file libc.so.6 with link time reference

To work around this shortcoming one must download, compile and install the following stub:

wget ftp://people.redhat.com/drepper/libcwait.c
gcc -shared -o libcwait.so libcwait.c -fpic -O
mv libcwait.so /usr/lib
/sbin/ldconfig


Gluing it all together

To utilize this stub one must export LD_PRELOAD=/path/to/libcwait.so

sh:

LD_PRELOAD=/usr/lib/libcwait.so && /opt/oracle/product/path/command
export LD_PRELOAD=/usr/lib/libcwait.so

csh:

setenv LD_PRELOAD /usr/lib/libcwait.so

Do NOT export LD_PRELOAD unless you are running an application (such as the oracle installer) which exhibits the above behavior..