I have been trying to set enviroment variables that would be saved upon reboot, but without success. When I set variables using the export or setenv command, as root or any other user, it gets saved on the session until reboot. After reboot, the variables are lost.In particular I need to set $JAVA_HOME.So I do like this but nothing is working as I indicated.What am I doing wrong?
Setting persistent environment variable in CentOS 7 issue
centos
Depending on your shell, there usually has to be a .<shellnamehere>rc file where you can store these variables that you want persisting across logout and reboot events. .bashrc is where you do it if your shell choice is bashEDIT:in the terminal, run commandenv | grep SHELLif you see SHELL=bash then, run this command:echo 'export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.71-2.b15.el7_2.x86_64' >> $HOME/.bashrcthis last command have some assumptions. If your SHELL doesn't come up as bash come back here and report what you get. After a logout and login back if you don't see your variable already set, again come back and report what error messages you see, if any.