Linux JAVA in path but permissions denied

Deko picture Deko · Nov 1, 2014 · Viewed 48.1k times · Source

Im trying to get JAVA enabled on Intel Edison which uses Yocto (Linux), the problem is that after extracting the zip, im able to check the version, and when putting it into the path, im not able to access java at all due permissions.

Specifically im trying to follow this tutorial but i get "stuck" at the

. .profile

since next step

java -version

throws same issue as pasted below, permissions denied or as earlier, java was not found.

Heres a quick overview of output:

root@dedsec1:~/java/jdk1.7.0_67/bin# ./java -version
java version "1.7.0_67"
Java(TM) SE Runtime Environment (build 1.7.0_67-b01)
Java HotSpot(TM) Client VM (build 24.65-b04, mixed mode)
root@dedsec1:~/java/jdk1.7.0_67/bin# cd
root@dedsec1:~# echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/root/bin:/home/root/java/jdk1.7.0_67/bin:/home/root/java/jdk1.7.0_67/bin
root@dedsec1:~# ./java -version
-sh: ./java: Permission denied
root@dedsec1:~#

What the hell am i missing ? I have set chmod -x on java but it doesnt seem to affect it.

Answer

Srinivasu picture Srinivasu · Nov 1, 2014
sudo chmod a+x /usr/bin/java
sudo chmod a+x /usr/bin/javac
sudo chmod a+x /usr/bin/javaws
sudo chown -R root:root /usr/lib/jvm/jdk1.8.0