Home > other >  I'm trying to set JAVA_HOME and path for JDK on Linux using .bashrc. But it says [ Error writin
I'm trying to set JAVA_HOME and path for JDK on Linux using .bashrc. But it says [ Error writin

Time:05-29

I'm trying to set JAVA_HOME and path for JDK on Linux using .bashrc (through enter image description here

[Press Enter]

Step 2:

export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export PATH=$JAVA_HOME/bin:$PATH

enter image description here

Step 3:

[Type Ctrl x]

enter image description here

Step 4:

[Type Y]

enter image description here

Step 5:

[Type Enter] (According to this enter image description here

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!

CodePudding user response:

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

  • Related