Issue
I'm trying to set JAVA_HOME and path for JDK on Linux using .bashrc (through this tutorial):
Step 1:
$ nano .bashrc
[Press Enter]
Step 2:
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export PATH=$JAVA_HOME/bin:$PATH
Step 3:
[Type Ctrl+x]
Step 4:
[Type Y]
Step 5:
[Type Enter] (According to this post)
As you can see, it is not allowing me to write .bashrc. What could I be doing wrong? I've researched similar errors but none have the same situation I am in. I would appreciate your experience and knowledge in this subject. Thanks!
Solution
You're trying to create a new file in the root directory /
, where a normal user doesn't have permission to write. The file you must edit is located in your home directory, so open the editor this way: nano ~/.bashrc
Answered By - emilianolch Answer Checked By - Pedro (WPSolving Volunteer)