I want the environment variable set in Terminal to be permanent.

Asked 2 years ago, Updated 2 years ago, 115 views

I changed JAVA_HOME to terminal, but the terminal on another tab returns to the original setting.

What should I do if I want to permanently reflect the environment variables that I set in Terminal?

Writing directly into .bash_profile is troublesome, so I would like to do it with terminal.

export JAVA_HOME=`/usr/libexec/java_home-v1.7`

bash

2022-09-30 18:51

1 Answers

Why don't you redirect it normally?

echo'export JAVA_HOME=`/usr/libexec/java_home-v1.7`'>~/.bash_profile


2022-09-30 18:51

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.