Environment Aliases
Custom Environment Variables
Customize Variables through the Dashboard
1Open the Variables section
Hover over the required node group in the dashboard, expand Additionally, and select Variables.
2Add, edit, or remove variables
Use the toolbar in the opened panel to manage the environment-variable list according to your application requirements.
$HOME is resolved according to the current HOME variable.
Click Apply after completing the required changes.
Set Variables through Shell Configuration
Custom variables can also be defined through standard shell configuration files:
~/.bash_profileis executed when the user signs in through the console.~/.bashrcis executed for every new Bash session.
The platform includes the .bashrc source from .bash_profile, so custom variables can normally be maintained in .bashrc.
1Connect to the container
Establish an SSH connection. The embedded Web SSH client can be opened directly from the dashboard.
2Add custom variables
Create or edit ~/.bashrc and add variables using the following format:
export {var_name}={var_value}
{var_name}— name of the custom variable.{var_value}— value assigned to the variable.
3Apply and verify the variables
New Bash sessions load the variables automatically. To apply them to the current session immediately, reload the configuration and print the variable value:
source ~/.bashrc
echo ${var_name}
Adjust Java Variables through Configuration Manager
The following workflow applies to platform-managed Java application servers.
1Open Configuration Manager
Click Config beside the Java application server to open the built-in file manager.
Navigate to variables.conf at the appropriate stack-specific location:
- Tomcat and TomEE:
/opt/tomcat/conf/variables.conf - Jetty:
/opt/jetty/etc/variables.conf - Spring Boot:
/opt/shared/conf/variables.conf - GlassFish:
/opt/glassfish/glassfish/domains/domain1/config/variables.conf - Payara:
/opt/payara/glassfish/domains/domain1/config/variables.conf - WildFly:
/opt/wildfly/conf/variables.conf
2Add Java variables or JVM properties
Enter each value on a separate line or separate the values with spaces. For example:
-Dvar1=value1 -Dvar2=value2 -Dmy.var3=/my/value
Save the configuration after making the required changes.
3Restart the Java nodes
Restart the application-server nodes to apply the new variables.
The values can then be retrieved in Java through System.getProperty():
String var1 = System.getProperty("var1");
String var2 = System.getProperty("var2");
String var3 = System.getProperty("my.var3");
What’s next?
- Default Environment Variables
- Java Options and Arguments
- Container Variables
- Configuration File Manager
