If you want Java on Windows with the least drama and maximum caffeine savings this guide will walk you through downloading a JDK installing it setting environment variables and confirming everything actually works. Yes you will need admin rights once or twice. No you do not need to sacrifice a hard drive.
Choose a build provider such as Oracle or an OpenJDK build like Eclipse Temurin or Amazon Corretto. For most people pick a long term support build to avoid surprises in the middle of a sprint. Download the Windows x64 installer for the JDK version you want and save it somewhere you can find later.
Right click the downloaded installer and run as administrator. Follow the prompts. Default install locations are fine for most developers. The installer will create a JDK home folder that we will reference from environment variables later.
Open System Properties then Advanced then Environment Variables. Create a new user or system variable named JAVA_HOME and set the value to the JDK home folder path. For example C\Program Files\Java\jdk-17. Using JAVA_HOME avoids hard coding full paths inside scripts and keeps life sane.
Edit the PATH variable and add %JAVA_HOME%\bin near the front so java and javac run from your chosen JDK. Save and close the dialog. Restart any open Command Prompt or PowerShell windows so they pick up the change.
Windows resolves executables by scanning PATH from left to right. Placing your JDK near the front ensures your tools use the JDK you just installed rather than an ancient Java from whatever random app installed years ago.
Open a new Command Prompt or PowerShell window and run the following commands to confirm both the runtime and compiler are correct.
java -version
javac -version
Both commands should show the installed JDK version. If a different version appears run where java
and where javac
to see which executables are being found and adjust PATH order or uninstall the other JDK.
where java
to locate which java executable is being used and adjust PATH accordingly.This guide covered downloading a JDK running the installer setting JAVA_HOME updating PATH and verifying command line tools. Follow these steps and your Windows machine will be ready to compile and run Java programs and to play nicely with IDEs and build tools. If anything goes sideways come back here and read it again while you drink something strong.
I know how you can get Azure Certified, Google Cloud Certified and AWS Certified. It's a cool certification exam simulator site called certificationexams.pro. Check it out, and tell them Cameron sent ya!
This is a dedicated watch page for a single video.