Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've installed java by following this instruction and also had installed java 7 from elsewhere but I can't seem to get it to work.. every time I type in java -version via terminal (I am ssh-ing to an ubuntu server) I get this:

root@ip-(...):/# java -version
bash: /usr/local/bin/java: No such file or directory

This is my Path variable:

root@ip-(...):/# echo $PATH

The path variable has two mentions of jre/bin but apart from that I don't see anything strange (and this was because I installed it twice? - but either way, it shouldn't matter)

So how do I debug why my java -version returns no such file or directory error when I can clearly see that the directory does have java in it?

I don't know what other info I need to provide since I am a ubuntu beginner, but please ask if you need anything else.

share|improve this question
Cant be sure but just check it out once… – Shagun Nov 16 '12 at 11:46
up vote 2 down vote accepted

I don't think PPAs work any more.

The most popular way NOW is: NOTE: build .deb from OTN binaries and set up a local repository, install from there.

You can run update-alternatives --config java and see installed JDK/JRE and configure.

share|improve this answer
hi, update-alternatives --config java and selecting option 0 fixed it for me, no idea what was wrong but it works now, thanks! – iamserious Nov 16 '12 at 13:00

Your Answer


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.