How to add JAVA_HOME on Ubuntu?

On Ubuntu, we can add JAVA_HOME environment variable in /etc/environment file. Note /etc/environment system-wide environment variable settings, which means all users use it. It is not a script file, but rather consists of assignment expressions, one per line. We need admin or sudo to modify this it. Further Reading Ubuntu – EnvironmentVariables 1. JAVA_HOME 1.1 …

Read more

How to install Java JDK on macOS

This article shows how to install Java JDK on macOS, Homebrew package manager, manual installation, and switch between different JDK versions. Tested with macOS 11 Big Sur Homebrew 2.7.4 JDK 8, 14, 16, 16 (AdoptOpenJDK and OpenJDK) Topics Homebrew install latest Java (OpenJDK) on macOS Homebrew install Java 8 (OpenJDK) on macOS Homebrew install a …

Read more

How to Set $JAVA_HOME environment variable on macOS

This article shows how to set the $JAVA_HOME environment variable on older Mac OS X and the latest macOS 11. Topics macOS release history What is /usr/libexec/java_home $JAVA_HOME and macOS 11 Big Sur $JAVA_HOME and Mac OS X 10.5 Leopard $JAVA_HOME and older Mac OS X Switch between different JDK versions Solution Steps to set …

Read more