середа, 13 березня 2019 р.

System environment variable in Centos 7

On my virtual-box machine (Centos 7) I tried to set the system environment variable via terminal like that:
export ADMIN_CONSOLE_HOME=" path to the folder"

and got the system environment variable in my Java code:
System.getenv("ADMIN_CONSOLE_HOME")

However, it didn`t help and returned NULL. Using Google-power I found out the solution how to set variables in Linux OS.
In my case, I added the following record to /root/.profile:
export ADMIN_CONSOLE_HOME=" path to the folder"

And after reboot all was fine. 

Немає коментарів:

Дописати коментар