How to install Java (JDK) on Windows step by step

Last update: 25/06/2025
Author Isaac
  • Java JDK is a must for programming and running Java applications on Windows.
  • It is vital to differentiate between JDK (includes development tools) and JRE (execution only).
  • Correctly setting the PATH variable allows you to use Java from any location.

Java

If you've made it this far, you're probably interested in learning how to install Java (JDK) on Windows from scratch . Whether you want to get started in programming , need to run a specific Java application, or simply find yourself needing a suitable development environment, you're in the right place. Here, we'll explain in detail and in a straightforward manner how to download, install, and correctly configure the Java JDK on your Windows computer, without skipping any important steps, whether you're using Windows version 10, 11, or later.

We'll clear up all your doubts: what to download, where to download it from, how to install it, and how to get it working both in the command line and in your favorite editor . We'll also explain why it's so important to know the difference between JRE and JDK, what the famous PATH environment variable is, and what common problems you might encounter during the process.

What is the JDK and why do you need to install it?

what is java

The first thing you should know is that Java is one of the most popular and powerful programming languages , used on millions of devices and applications. To develop and run Java programs on your computer, you need to have the Java Development Kit (JDK) installed . This kit includes essential tools such as the compiler , interpreter , debugger , and Java Virtual Machine (JVM) . In other words, everything you need to both create and test your own programs.

The Java Development Kit (JDK) is often confused with the Java Runtime Environment (JRE) , which is simply the runtime environment, intended for those who want to use Java apps but not program them. The JDK is the full version, with all the development tools a programmer needs, so if you intend to start programming in Java, this is the version you should install.

How to check if you already have Java installed on Windows

Before starting the installation, it's a good idea to check if you already have a version of Java on your computer. Your computer may have an older version, but it may not be configured correctly or may not include the full JDK. To check:

  • Open the symbol of the system (you can search for “cmd” in the start menu).
  • Write java -version and press Enter. If you see information about an installed version, it means you have the JRE or even the JDK. If you get an error message, you probably don't have anything installed or it's not configured correctly.
  • To make sure, run javac-version or simply JavacIf you see an error indicating that the command is not recognized, it is likely that the compiler (present only in the JDK) not availableIf the version appears, you already have the JDK ready to use.
  Website Blocking Software. The 7 Most Effective

JDK Download: Versions and Alternatives

Today, there are several Java distributions available, the most well-known being Oracle 's and OpenJDK , the open-source alternative. The procedure is similar in both cases, and for personal use and learning, you can choose whichever you prefer. Let's focus on the most common option for beginners : downloading the JDK from the official Oracle website.

  • Visit official Java download page.
  • Look for the section for “Java SE Development Kit” (the latest version is usually prominently displayed).
  • Choose the appropriate package for your operating system – usually “Windows x64 Installer” if you have modern 64-bit Windows.
  • Please accept the Oracle license terms before downloading.
  • Save the file to a folder of your choice: this is usually an .exe (installer) file, or you can also download a compressed (.zip) file if you prefer to install it manually, although for most users the installer is the easiest.

Step-by-step installation of the JDK on Windows

Once you've downloaded the JDK file, it's time to install it on your Windows computer. The installation wizard will guide you through the installation process, but here's a breakdown of what you can expect:

  1. Run the installer by double-clicking on the downloaded file (usually called something like jdk-xx_windows-x64_bin.exe).
  2. A User Account Control prompt may appear, requesting permission to make changes to the device. Confirm the request.
  3. The wizard will open showing a welcome screen: click on Next to continue.
  4. You will choose the installation location (by default it is usually “C:\Program Files\Java\jdk…” and it is usually the best option to avoid complications).
  5. A screen will appear for selecting components. Normally, you don't need to change anything: leave everything selected by default (usually including Development Tools, Source Code, and Public JRE) checked.
  6. The installer will automatically extract and copy the files. In some cases, it may ask you to specify the folder where the JRE (Java Runtime Environment, included in the JDK) will go. If so, leave the suggested path or change it only if you know what you're doing.
  7. Once finished, you'll see a screen indicating that the installation was successful. The installer may now show you some additional resources (tutorials, documentation, etc.). You're done. Java JDK installed on your Windows.

Setting Environment Variables in Windows

Even though the JDK is already installed, Windows won't know where to find your applications unless you add it to the PATH environment variable . This step is essential to be able to run commands like javac or java from any command prompt window. To learn more about managing environments in Windows, you can consult our guide on managing environment variables in Windows and other systems.

  • Right click on the button Home Windows and choose “System”.
  • In the window that opens, find "Advanced System Settings" or "System Properties" and click on it. Then, go to the "Advanced" tab and click the "Environment Variables" button.
  • In the "System Variables" section, find the variable named "Path" and select it. Click "Edit."
  • In the editing window, at the bottom of the list, click "New" and enter the path to the "bin" folder of your JDK installation. It's usually something like this: C:\Program Files\Java\jdk-XX.X.X_xx\bin (the version number changes depending on the one you have installed).
  • Click “OK” in all open windows to save the changes. Important! Don't delete any of the other paths already in the PATH, just add the new line.
Related articles:
What is the best way to install Android Studio 32Bit on Windows 7 32Bit

Verify that the installation and configuration was successful

You're almost there. All that's left is to check that everything is perfect. To do this:

  • Open a new command prompt window (cmd).
  • Write java -version and press Enter. You should see the newly installed Java version.
  • Write javac-version and confirms that the correct version also appears.
  • If both commands return the newly installed version, you have correctly configured your environment and can begin compiling Java programs without any problems.
  Learn how to prevent others from controlling your Chromecast device

What to do if Java doesn't work after installation?

There are some common mistakes you may encounter:

  • The 'java' or 'javac' command is not recognized.: This indicates that the JDK path is not entered correctly in your PATH. Review the previous step and make sure you haven't missed any characters or entered a wrong version.
  • You have multiple versions of Java installed: Sometimes other applications include their own JRE. Make sure the PATH points to the "bin" folder of the most recent JDK.
  • insufficient permissionsIf your account isn't an Administrator account, you may experience problems. Try running the installer or Command Prompt as Administrator.

Download and install OpenJDK on Windows (free alternative)

As an alternative to the official Oracle version, OpenJDK offers a completely free development environment. The process is very similar:

  • Visit the official OpenJDK website or reputable portals such as Adoptium or Amazon Corretto.
  • Download the appropriate installer for Windows. Many distributors offer .msi installers that make your life easier.
  • The process is just as simple: run the installer, accept the license, choose the destination folder, and follow the steps.
  • Don’t forget to add the “bin” folder to your PATH, just like with the Oracle JDK.
  • Check operation as described above.

Post-installation recommendations for Java developers

  • We recommend you install a good code editor or IDE specialized in Java development, such as Eclipse, IntelliJ IDEA, or NetBeans. This way, you'll take advantage of all the utilities included in the JDK.
  • Do simple tests by compiling your first Hello World puedo cambiarlo In Java, opening a .java file from the editor, compiling and running it with the commands Javac y Java to make sure everything works perfectly.
  • If you're going to be working on complex projects, it may be worthwhile to also install tools like Maven or Gradle to manage dependencies and automate tasks.
  • Remember to regularly check for new JDK versions to keep your environment up-to-date and secure.
  Delete Continuously Visited Websites on iPhone Safari Browser

Updates and management of different versions

Java evolves rapidly, with new updates and Long Term Support (LTS) versions released every few months. If you need to work with multiple Java versions on the same machine, tools like SDKMAN! (more commonly used on Linux/Mac) or version control scripts are available for Windows. Alternatively, you can manually change the PATH environment variable depending on the project you're compiling. Always keep the official documentation and download websites handy to avoid installing outdated or insecure versions.

Once you know how to install and configure the JDK, you'll find it much easier to tackle any Java-based project, install frameworks, application servers, or development platforms like Android Studio. For more advanced topics, you can consult how to troubleshoot common errors in Java and other platforms.

Setting up your Java environment properly might seem daunting at first, but once you understand the concepts of PATH, environment variables, and the differences between the JRE and JDK , you'll find it's all about patience and attention to detail. This will allow you to focus on what matters most: learning and enjoying programming in one of the world's most powerful and universal languages.

Isaac

Isaac

Passionate writer about the world of bytes and technology in general. I love sharing my knowledge through writing, and that's what I'll do on this blog, show you all the most interesting things about gadgets, software, hardware, tech trends, and more. My goal is to help you navigate the digital world in a simple and entertaining way.