This problem refer to the installation of old JDKs on 64bit Linux systems.

When java command is executed at shell, generally, you will receive this error message:

Error: can't find libjava.so.

To solve this problem just edit 3 files located at JDK installation dir and be happy :)

  • $JAVA_HOME/bin/.java_wrapper
  • $JAVA_HOME/jre/bin/.java_wrapper
  • $JAVA_HOME/jre/bin/realpath

All these 3 files have similar code snippet as bellow:

    case "`uname -m`" in
        i[3-6]86 | ia32 | ia64 | i?86)
            proc=i386
            ;;
        sparc*)
            proc=sparc
            ;;
        *)
            proc=unknown
            ;;
    esac

Edit each file and  include the architecture x86_64 in the first case-statement and the problem will be fixed:

i[3-6]86 | ia32 | ia64 | i?86 | x86_64)