I was installing JDK7 on Ubuntu 12.04 by following the guide posted on web8. The commands posted in the guide were:
sudo mkdir -p /usr/lib/jvm/ #just in case
sudo mv java-7-oracle/ /usr/lib/jvm/
sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install update-java
sudo update-java
Till here everything went well. So hopefully jdk was installed correctly, but then when I tried to check the java
version with the command:
java -version
...it gave me this error:
bash: /usr/bin/java: Permission denied
Yes i know this is a permission related issue. And it can be solved using the sudo
command, but can someone tell the exact command? I also checked permissions using ls -l
command and the output was:
-rw------- 1 ankit ankit 5650 Jun 27 2011 java
-rw------- 1 ankit ankit 5805 Jun 27 2011 javac
None of the tutorials and videos i saw were having this issue why is it only me?have i messed up with some default configurations? do i need to change the permission to the /usr/
directory evrytime?
I know this may sound stupid to many here, but i really want to know exactly where I am going wrong.