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

Asked 1 years ago, Updated 1 years ago, 102 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.