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'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.

share|improve this question
    
Cant be sure but just check it out once askubuntu.com/questions/186422/problem-by-installing-java/… –  Shagun Nov 16 '12 at 11:46

1 Answer 1

up vote 2 down vote accepted

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.

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

 
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.