Table of Content
Windows:
-
- Download the JDK (Java Development Kit):
-
- Visit the Java SE Downloads page on the official Oracle website: Java SE Downloads.
- Accept the terms of the license.
- Click the download link after selecting the JDK version that works best for your Windows x64 or x86 system.
-
- Run the Installer:
-
- Double-click the downloaded file (which is often a.exe file) to launch the installer after the download is finished.
-
- Follow the Installation Wizard:
-
- You will be guided through the installation procedure by the installation wizard. Observe the directions displayed on screen.
- Select the installation directory along with any other settings you wish to use.
- To start the installation procedure, click either "Next" or "Install".
-
- Verify Installation:
-
- Press the Windows key + R to launch Command Prompt after the installation is finished, then type "cmd" and hit Enter.
- Enter 'java -version' after typing it. Information on the installed version of Java should be visible.
Linux:
-
- Install OpenJDK (Java Development Kit):
-
- Most Linux distributions usually have OpenJDK accessible in their default repositories. Utilizing the package manager, you can install it.
For Debian/Ubuntu:
sqlsudo apt update sudo apt install default-jdkFor Fedora:
sudo dnf install java-develFor CentOS/RHEL:
sudo yum install java-devel -
- Verify Installation:
-
- Once the installation process is finished, launch a terminal.
- Enter 'java -version' after typing it. Information on the installed version of Java should be visible.
Optional: (Windows only) Configure environment variables:
- You might need to add the location where Java is installed to the 'PATH' environment variable in order to use Java from the command line. Usually, while installing Windows, this step is completed automatically. If not, manual labor can be used:
- Choose "Properties" from the context menu when you right-click "This PC" or "My Computer".
- From the list of options on the left, choose "Advanced system settings".
- Select "Environment Variables" by clicking the button.
- Locate and click "Edit" on the "Path" variable under "System Variables".
- Include the path (for example, 'C:\Program Files\Java\jdk-15\bin') to the 'bin' directory of your JDK installation in the list of paths.
- To save the modifications, click "OK".
That's it! Java is now installed successfully on your Linux or Windows computer. Now you can begin working on building