Java JDK (Java Development Kit) is a software development environment used to develop and run Java applications. In order to start coding in Java, you need to install the Java JDK on your computer. This article will guide you through the process of installing Java JDK using the command prompt (cmd) on Windows.
Step 1: Check if Java is already installed
Before installing Java JDK, it's important to check if Java is already installed on your computer. Open the command prompt by pressing Win + R, type cmd, and press Enter. In the command prompt, type java -version and press Enter. If you see a version number displayed, it means Java is already installed and you can skip to Step 3. If not, proceed to Step 2.
Step 2: Download Java JDK
Go to the official Oracle website (https://www.oracle.com/java/technologies/javase-jdk11-downloads.html) and download the latest version of Java JDK. Make sure to select the correct version for your operating system (Windows, macOS, or Linux).
Step 3: Set up Java Environment Variables
After downloading Java JDK, you need to set up the Java environment variables. Open the command prompt and type the following commands:
setx /M PATH "C:\path\to\jdk\bin;%PATH%"setx /M JAVA_HOME "C:\path\to\jdk"
Replace C:\path\to\jdk with the actual path where you installed Java JDK. For example, if you installed Java JDK in C:\Program Files\Java\jdk-11.0.9, the commands would be:
setx /M PATH "C:\Program Files\Java\jdk-11.0.9\bin;%PATH%"setx /M JAVA_HOME "C:\Program Files\Java\jdk-11.0.9"
After executing these commands, close the command prompt and open a new command prompt to apply the changes.
Step 4: Verify Java JDK installation
To verify if Java JDK is installed correctly, open the command prompt and type java -version. You should see the version number of the Java JDK installed on your computer.
Congratulations! You have successfully installed Java JDK using the command prompt.
Conclusion
Installing Java JDK is an essential step to start coding in Java. By following the steps mentioned in this article, you can easily install Java JDK using the command prompt on your Windows computer. Remember to always download the latest version of Java JDK from the official Oracle website to ensure you have the most up-to-date features and security patches.
References
| Website | Link |
|---|---|
| Oracle Java SE Downloads | https://www.oracle.com/java/technologies/javase-jdk11-downloads.html |