System Level Environment Variables in RHEL 7Environment variables are created using export statement. In order to create a system wide environment variable, the export must be executed when any user is logged-in.
You can copy scripts that need to be executed when a user is logged-in in /etc/profile.d directory. Just create a file with extension .sh (e.g. envVars.sh) and copy the following:
And update the contents with the following:
Now try creating another bash session on the server using Putty and run java