Unable to run java in redhat os

I am unable to run java from jdk.
it says "cannot execute binary file"
I downloaded the jdk again freshly but the problem still persists.
All files have execution permission.
Both OS and JDK are 64bit.
Please help me out.

[XXXXX@YYYYYY bin]$ pwd
/home/XXXXX/apache-tomcat-6.0.18/jdk1.5.0_14/bin

[XXXXX@YYYYYY bin]$ java
bash: /home/XXXXX/java1.5/bin/java: cannot execute binary file

Are you checking the java file in the below location ?

 
[XXXXX@YYYYYY bin]$ java
bash: /home/XXXXX/java1.5/bin/java: cannot execute binary file

---------- Post updated at 03:19 PM ---------- Previous update was at 03:18 PM ----------

if you want to execute the java file which present under the /home/XXXXX/apache-tomcat-6.0.18/jdk1.5.0_14/bin, then you need to execute it like ./java

1 Like

Thanks, It worked.