All Products
Document Center

How do I get custom environment variables in an application

Last Updated: Feb 22, 2018
  1. Log on to the application server and switch to the admin account.

  2. Edit /home/admin/.bash_profile and add a custom environment variable in .bash_profile. After the environment variable is added, run source /home/admin/.bash_profile.

    Environment variable setting

    Environment variable setting 2

  3. After setting, obtain the environment variable using the System.getenv() method in the application code. Restart the application so that the configuration takes effect.