
Java bin directory will be appended to the existing PATH variable. As the JDK directory location has already been set up using the JAVA_HOME variable, now we can just use the JAVA_HOME attribute to set up the bin directory location.Įnter this command in Terminal to add the Java bin directory to the PATH variable: $ export PATH=$PATH:$JAVA_HOME/bin $PATH variable points to the bin directory under the JDK installation directory. Similar to the JAVA_HOME path, we will now add the $PATH variable as well.

In the output, you will see the value stored in the JAVA_HOME variable as displayed in the following screenshot.Īdd the JAVA bin directory to the PATH variable Now you have set the JAVA_HOME path, you can verify it by running the following command in Terminal: $ echo $JAVA_HOME To set the JAVA_HOME environment path, enter the following command in Terminal: $ export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64 Usually, it is /usr/lib/jvm/java-17-openjdk-amd64/. Set JAVA_HOME Pathįind out the installation path of OpenJDK on your system. Hit y and then Enter to confirm, after which the installation of Open JDK will be started on your system. The system might ask for confirmation by providing the Y/n option. When prompted for the password, enter the sudo password. Now in the Terminal, run this command as sudo to install Open JDK. From the results, click on the Terminal icon to open. Then search for the Terminal application by typing the relevant keyword in the search bar.

Go to the Activities tab in the top left corner of your desktop. Install OpenJDK on Debianįirst, launch the Terminal in your OS. The same procedure can be followed in other Linux distributions and older versions of Debian as well.


We have run the commands and procedure mentioned in this article on a Debian 11 system. In this article, we will learn how to install Java JDK on Debian OS and then set up the JAVA_HOME and PATH variables. It needs to be configured in all OSs with Java installed such as Linux, Windows, and macOS. JAVA_HOME is basically an OS environment variable that points to the directory where the JDK or JRE is installed on your system. After installation of JRE and JDK, you also need to set up JAVA_HOME in order for many java based applications to work properly. It requires the installation of the Java Runtime Environment (JRE) and Java Development Kit (JDK) in order to develop and run Java applications. Java is a very popular programming language that is used in desktop software development, mobile applications, business applications, and so on.
