Honeybadger Honeybadger - 1 year ago 100
Linux Question

64-bit java glibc dependency, not compatible

Could someone please give me some suggestions on how to solve this java program? Thank you so much.
I need to run the 64-bit java on and 64-bit CentOS system, but the program is not compatible with my glibc-2.14 library. I build this glibc library manually and added it to my LD_LIBRARY_PATH cause I have no ROOT privilege and I need that library for some other programs.

I can successfully run the 32 bit version:

[gmswenm@login-7-0 ~]$ java -version
java version "1.8.0_92"
Java(TM) SE Runtime Environment (build 1.8.0_92-b14)
Java HotSpot(TM) Server VM (build 25.92-b14, mixed mode)

But my pipeline needs the 64 bit java, when I run the 64 bit version with the same command, the command get stuck. When I remove the glibc from the the link path, it can be run smoothly, but then I can't run the other programs, it's so sad.

The strace information for the 64 bit java is here, thanks:

[gmswenm@login-7-0 ~]$ strace jdk1.8.0_92/bin/java -version:

execve("jdk1.8.0_92/bin/java", ["jdk1.8.0_92/bin/java", "-version"], [/* 120 vars */]) = 0
brk(0) = 0x980000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f643e655000
readlink("/proc/self/exe", "/home//jdk1.8.0_92/bin/java", 4096) = 34
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)

futex(0x7f643ca249d0, FUTEX_WAIT, 11029, NULL <unfinished ...>

Answer Source

This answer explains why you can't simply set LD_LIBRARY_PATH to point to different GLIBC, and what to do to achieve your desired result.