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:
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.
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.
Немає коментарів:
Дописати коментар