I set the Java command to an alias in my /home/.bashrc
.
alias java='/home/documents/jdk1.7/bin/java'.
However, typing java
results in:
bash: /home/documents/jdk1.7/bin/java: permission denied
The problem is you do not have permission to access or launch that file under the user you are launching it from.
Since you are using alias
the user account accessing the shell needs to have the proper permissions to read/write or execute the file being referenced by the alias.
To test this you could chmod -R a+rX /home/documents/jdk1.7
it should work ... this is not a recommended permission for it but at least that should narrow the problem down.
java
read/write/execute for any user ... it only has to be ran once but again .. this can be a security risk because now anyone can run that file.
May 3, 2016 at 3:13
ls -l /home/documents/jdk1.7/bin/java
?