1

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
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/root/bin:/usr/local/java/jre1.7.0_09/bin:/root/bin:/usr/local/java/jre1.7.0_09/bin

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.

1 Answers1

2

I don't think PPAs work any more.

The most popular way NOW is: https://github.com/flexiondotorg/oab-java6 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.

Terry Wang
  • 9,775
  • 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