To install the Java Development Kit (JDK) on your system, you will need to follow a few steps that depend on your operating system and the version of Java you want to install. Here is a general outline of the steps you will need to follow:
Download the JDK from the Oracle website (https://www.oracle.com/java/technologies/javase-downloads.html). Make sure to download the JDK, not the Java Runtime Environment (JRE).
Install the JDK by following the instructions provided in the installation wizard or the installation instructions provided with the JDK. The exact steps will vary depending on your operating system.
Set the JAVA_HOME environment variable to the path of the JDK installation. This will allow other programs to find the JDK on your system.
Add the bin directory of the JDK installation to your PATH environment variable. This will allow you to run the java and javac commands from any directory.
Here are some more detailed instructions for installing the JDK on specific operating systems:
JAVA_HOME environment variable and add the bin directory of the JDK installation to your PATH environment variable. You can do this by following these steps:This PC icon and select Properties.Advanced system settings link.Environment Variables button.System Variables section, scroll down and find the JAVA_HOME variable. If it doesn't exist, click the New button to create it. Set the value of the JAVA_HOME variable to the path of the JDK installation, such as C:\Program Files\Java\jdk1.8.0_251.System Variables section, find the Path variable and click the Edit button.New button and add the bin directory of the JDK installation to the Path, such as C:\Program Files\Java\jdk1.8.0_251\bin.OK to save the changes and close the windows.JAVA_HOME environment variable and add the bin directory of the JDK installation to your PATH environment variable. You can do this by following these steps:Terminal application.bash_profile file in a text editor:nano ~/.bash_profile
export PATH=$PATH:/usr/local/java/jdk/bin