Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm trying to re-install Oracle JDK 7 32 bit to 64 bit Ubuntu (previously 64 bit JDK was installed). JDK is currently present at /usr/lib/jvm/jdk1.7.0. I invoke

sudo update-alternatives --remove "java" "/usr/lib/jvm/jdk1.7.0/bin/java"
sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.7.0/bin/java" 1

And then:

/usr/lib/jvm/jdk1.7.0/bin$ java
bash: /usr/bin/java: No such file or directory

Why java can't be invoked?

share|improve this question
add comment

2 Answers 2

up vote 14 down vote accepted

This message is shown because some 32 bit libraries are absent in Ubuntu 64 bit. Run:

apt-get install libc6-i386

See Java is installed, in listing, but execution produces “./java: No such file or directory” for more details

share|improve this answer
    
are these library jre-specific or are these libraries required for other packages too? –  ShuklaSannidhya Apr 3 '13 at 4:23
add comment

what u are doing is trying to execute binary file without telling its path,
for executing java binary try "./java" in bin folder else include its whole path and for installation you may try this :- http://www.devsniper.com/ubuntu-12-04-install-sun-jdk-6-7/

share|improve this answer
    
When in bin folder ./java outputs "No such file or directory" –  Andrey Botalov Oct 28 '12 at 9:11
    
list all files in that dir and see if there is such file or not if its not then i think u have to re-install it –  r4jiv007 Oct 28 '12 at 9:13
    
There is "java" file there. It's in light green –  Andrey Botalov Oct 28 '12 at 9:18
    
try to run the commands mentioned in the link i provided, see whether that helps !! –  r4jiv007 Oct 28 '12 at 9:22
    
I've already runned all those commands with zero success. I have the same output "bash: /usr/bin/java: No such file or directory" –  Andrey Botalov Oct 28 '12 at 9:36
show 2 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.