On RHEL 6.7, I've added the file /etc/environment:
JAVA_HOME="/opt/jdk1.8.0_91"
JRE_HOME="{JAVA_HOME}/jre"
M2_HOME="/usr/local/apache-maven"
M2="{M2_HOME}/bin"
PATH="{JAVA_HOME}/bin:{JRE_HOME}/bin:{M2}:{PATH}"
Now on login, bash gives the following errors:
-bash: id: command not found
-bash: id: command not found
-bash: id: command not found
-bash: uname: command not found
Removing or renaming /etc/environment makes the problem go away.
Note: I do not want to use /etc/profile because I want these settings to be available to non-interactive shells.