Answer the question
In order to leave comments, you need to log in
How to keep a file open in ubuntu terminal?
task
sudo edit /etc/environment
# At the end of the file add the line JAVA_HOME="/usr/lib/jvm/java-8-oracle"
source /etc/environment
echo $JAVA_HOME
stuck on the second step, I can not save the edited file through the terminal
contral +x
contrl+esc
contrl+o
esc
don't close/save the file
Answer the question
In order to leave comments, you need to log in
If you only need to add a line to the end of the file, isn't it easier to do something like that?
sudo echo "JAVA_HOME=\"/usr/lib/jvm/java-8-oracle\"" >> /etc/environment
echo "export JAVA_HOME=\"/usr/lib/jvm/java-8-oracle\"" >> ~/.bash_profile
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question