After having installed Java I want to write some programs. So I did. But when setting PATH variable permanently with command:

~/.bashrc export PATH=/home/pi/Downloads/jdk1.8.0/bin:$PATH

I get this error:

bash: /home/pi/.bashrc: Permission denied

How to fix this?


You're trying to execute .bashrc as a program, which won't work because it's a file and not an executable.

Instead, you need to add export PATH=/home/pi/Downloads/jdk1.8.0/bin:$PATH to .bashrc.

One way you can do this is by executing echo "export PATH=/home/pi/Downloads/jdk1.8.0/bin:$PATH" >> ~/.bashrc, which will append the export... command to the end of the .bashrc file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.