On Ubuntu, there are two system-wide environment variables, both files need admin or sudo to modify it. /etc/environment – It is not a script file, purely assignment expressions, one per line. /etc/environment PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games" JAVA_HOME=/usr/lib/jvm/adoptopenjdk-11-hotspot-amd64 LD_LIBRARY_PATH=/usr/local/lib:/usr/lib/postgresql/8.3/lib /etc/profile.d/*.sh – Files with .sh extension in the /etc/profile.d/ folder. /etc/profile.d/myenv.sh export JAVA_HOME=JAVA_HOME=/usr/lib/jvm/adoptopenjdk-11-hotspot-amd64 export LD_LIBRARY_PATH=/usr/local/lib:/usr/lib/postgresql/8.3/lib export PATH=$PATH:$JAVA_HOME/bin Further Reading: Ubuntu …
Read more