1

My OS is redhat linux. It's having the default java 1.4.2, but I need java 1.7.45, for that I am trying as follows:

/usr/sbin/alternatives --install /usr/bin/java java /u01/java7/bin/java 5
/usr/sbin/alternatives --install /usr/bin/java java /u01/java7/bin/java 2

/usr/sbin/alternatives --config java

  Selection    Command
-----------------------------------------------
   1           /usr/lib/jvm/jre-1.4.2-gcj/bin/java
 + 2           /u01/java7/bin/java

Here i am selecting 2nd one

After that i am getting the message

[root@localhost bin]# java --version
bash: /usr/bin/java: cannot execute binary file

so please give me solution for resolving this problem in redhat linux

[root@localhost bin]# java --version
bash: /usr/bin/java: cannot execute binary file
  • Can you execute /u01/java7/bin/java or does that give the same error? – wurtel Jan 29 '15 at 15:11
  • Could have been a binary for different architecture... – sendmoreinfo Jun 21 '16 at 18:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.