0

I have installed Java for RedHat Linux 5 ( 64-bit version) using online guide. After the installation, if run the below command to check java, it is giving the

error: "bash: /usr/bin/java: cannot execute binary file"

Command used: #java -version

My installation process didnt throw any errors.

Please help me in identifying the problem.

Arnab Nandy
  • 6,472
  • 5
  • 44
  • 50
SrinR
  • 923
  • 7
  • 16
  • 27
  • BTW: I would not use an old RHEL5 for new projects. – eckes Jan 23 '15 at 05:16
  • This is a wrong binary version or it can be a mismatch between a wrapper command expecting java to be a shell-script and the actual java beeing a binary. You say, you used the online guide, can you tell us what command you used? Did you install OpenJDK or IBM JDK with yum or did you use Oracle archives? What does "file /usr/bin/java" and "which java" and "echo $JAVA_HOME" tell you? Also add output of uname -a to make sure you really run 64bit kernel. Try to run the java directly (/opt/jdk/bin/java or whereever it is installed). – psycho Aug 05 '17 at 12:38

1 Answers1

0

This could be either a wrong binary (32bit version?) or it can be a mismatch between a wrapper command expecting java to be a shell-script and the actual java beeing a binary. You say, you used the online guide, can you tell us what command you used? Did you install OpenJDK or IBM JDK with yum or did you use Oracle archives?

What does "file /usr/bin/java" and "which java" and "echo $JAVA_HOME" tell you? Also add output of uname -a to make sure you really run 64bit kernel. Try to run the java directly (/opt/jdk/bin/java or whereever it is installed).

eckes
  • 10,103
  • 1
  • 59
  • 71