Java Location
PATH is an environmental variable that the system software now uses to find executable files (.exe) or Java binaries ( java or javac command). Once chosen, a route cannot be changed. The PATH variable saves us from manually entering a program's complete path on the Command Line Interface each time we launch it. Additionally, the route is essentially a variable that contains several shortcut keys.
Java is a continuous, class-based, object-oriented, etc. high-level programming language. Typically, Java programs are compiled to bytecode that may be executed on any Java programming language (JVM), independent of the architecture of the computer. Java version 18 is the most recent. The environmental variables for both Windows and Linux are listed below. As a result of the variations in Operating System setup, JVM, JRE, and JDK 3 are all platform-specific. However, Java is platform-neutral. Before setting up the environment, there are a few elements that must be understood, which are best understood from the following image:

JDK: The JDK (Java Development Kit) is a set of tools for computer programmers that include the Java compiler, Javadoc, Jar, and a debugger.
JRE, or even the Java Runtime Environment, is software designed for end customers and includes the components of the Java libraries needed to run Java applications. JDK may be thought of as a subset of JRE.
JVM: JVM (Java Virtual Machine) is an abstract machine. It is a standard that offers a runtime setting for Java bytecode execution. There are JVMs for several software and hardware systems.
Let's now have a graphic discussion of how to set up a Java environment. To demonstrate visual assistance, let's use the Windows operating system.
Here, we'll outline distinct operating systems' stages. They are as follows:
1. Window
2. Linux
1. operating systems for Windows
These steps are required for configuring the ecosystem in Windows:
Step 1: Download Java 8 JDK from the website. For Windows (32 bit) and Windows (64 bit), select the second-to-last link and the final link, respectively, as shown below.

Step 2: Run the.exe program after downloading it and follow the on-screen directions to install Java on their computer. Once Java has been installed on your computer, you must configure the environmental variable.
Step 3: Select System and Security from the Control Panel menu. Select Environment Variables from the Advanced System Setting menu by clicking on the below button.

Step 4: The final step is to change the "Path" option under Control parameters to include the path to the Java environment. Choose the "Path" variable and the Edit button, as shown below.

Step 5: After selecting New from the list of available paths, add the path where Java is installed. The "C: Program Files" or "C: Program Files(x86)" folders are where Java is normally installed. If you have Java installed somewhere else, add the path there.

2. Operating System Linux
There are several methods for installing Java on Linux. But we'll discuss the quickest and most straightforward method of installing Java via a terminal. We will set up OpenJDK on Linux. The Java programming language is implemented by OpenJDK, which is freely available and open-source. The steps that are required for configuring the environment in the Linux operating system:
Step1: In the first step, select Application > Accessories > Terminal.
Step 2: Type the following command:
sudo apt-get install openjdk-8-jdk
Step 3: In "Terminal," utilizing the location of the installation, execute the command as given following for the "JAVA HOME" (Environmental Variable). (Note: The default path is given below.)
export JAVA_HOME = /usr/lib/jvm/java-8-openjdk
Step 4: In "Terminal," enter the command which was given below using the install directory for "PATH" (Environment Value). (Note that the default configuration path is as indicated, but you may change it if you need to install OpenJDK somewhere else.)
export PATH = $PATH:/usr/lib/jvm/java-8-openjdk/bin
Completed the installation process of Java in Linux.
Note:
Enter the java -version inside the Terminal to confirm that the installation was successful. You'll see that Java is now operating on your computer.
- Simple text tools for writing Java applications are notepad and gedit. On Windows, notepad is accessible, and on Linux, gedit.
- Eclipse IDE: This combined development environment (IDE) has become the most popular for creating Java-based software. Eclipse can be downloaded.