Java libjava.so error
This was the day I am trying to run the "java" command on the server that has java5 jre installed. The problem is that I always get
Error: Could not find libjava.so Error: Could not find Java Runtime 2.
even if I run it from the install directory, / usr / lib / java 1.5 / jre / bin. I can see that libjava.so is in the .. / jre / lib / amd 64 directory, but not sure why not get it. Any hints would be greatly appreciated.
-Thank
source to share
A very strange error. I noticed that you are using a 64 bit OS. Found a link that talks about an issue between older versions of Java and 64-bit OS. Java 1.5 was released in 2004, and 64-bit processors were introduced only to the computer market in 2003. This could be the likely culprit.
For posterity (in case of deleting the page):
This issue is related to installing old JDKs on 64 bit Linux systems. When a java command is executed in a shell, in general you will receive this error message:
Error: Cannot find libjava.so.
To fix this problem, just edit 3 files located in the JDK installation directory and be happy
- $ JAVA_HOME / bin / .java_wrapper
- $ JAVA_HOME / JRE / bin / .java_wrapper
- $ JAVA_HOME / JRE / bin / Realpath
All these 3 files have a similar code snippet as shown below:
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 x86_64 architecture in the first case-statement and the problem will be fixed:
i[3-6]86 | ia32 | ia64 | i?86 | x86_64)
source to share